@verboo/code 0.7.26 → 0.7.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +258 -246
- package/package.json +1 -1
- package/scripts/postinstall.mjs +39 -1
package/package.json
CHANGED
package/scripts/postinstall.mjs
CHANGED
|
@@ -9,8 +9,9 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import { execFileSync, spawnSync } from 'node:child_process'
|
|
12
|
-
import { existsSync } from 'node:fs'
|
|
12
|
+
import { existsSync, mkdirSync, readdirSync, statSync, copyFileSync } from 'node:fs'
|
|
13
13
|
import { join } from 'node:path'
|
|
14
|
+
import { homedir } from 'os'
|
|
14
15
|
|
|
15
16
|
function isFishShell() {
|
|
16
17
|
const shell = process.env.SHELL ?? ''
|
|
@@ -35,6 +36,41 @@ function fishAddPath(dir) {
|
|
|
35
36
|
return result.status === 0
|
|
36
37
|
}
|
|
37
38
|
|
|
39
|
+
function copyDirRecursive(src, dest) {
|
|
40
|
+
let copied = false
|
|
41
|
+
if (!existsSync(dest)) mkdirSync(dest, { recursive: true })
|
|
42
|
+
for (const entry of readdirSync(src)) {
|
|
43
|
+
const srcPath = join(src, entry)
|
|
44
|
+
const destPath = join(dest, entry)
|
|
45
|
+
if (existsSync(destPath)) continue
|
|
46
|
+
const stat = statSync(srcPath)
|
|
47
|
+
if (stat.isDirectory()) {
|
|
48
|
+
if (copyDirRecursive(srcPath, destPath)) copied = true
|
|
49
|
+
} else {
|
|
50
|
+
copyFileSync(srcPath, destPath)
|
|
51
|
+
copied = true
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return copied
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function importFromClaudeCode() {
|
|
58
|
+
const claude = join(homedir(), '.claude')
|
|
59
|
+
const verboo = join(homedir(), '.verboo')
|
|
60
|
+
for (const asset of ['skills', 'plugins']) {
|
|
61
|
+
const src = join(claude, asset)
|
|
62
|
+
const dest = join(verboo, asset)
|
|
63
|
+
if (!existsSync(src)) continue
|
|
64
|
+
try {
|
|
65
|
+
if (copyDirRecursive(src, dest)) {
|
|
66
|
+
process.stdout.write(`[verboo] ${asset} imported from Claude Code.\n`)
|
|
67
|
+
}
|
|
68
|
+
} catch (err) {
|
|
69
|
+
process.stdout.write(`[verboo] Import of ${asset} from Claude Code failed: ${err.message}. Proceeding without import.\n`)
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
38
74
|
if (isFishShell()) {
|
|
39
75
|
const binDir = getNpmGlobalBin()
|
|
40
76
|
if (binDir && existsSync(binDir)) {
|
|
@@ -50,5 +86,7 @@ if (isFishShell()) {
|
|
|
50
86
|
}
|
|
51
87
|
}
|
|
52
88
|
|
|
89
|
+
importFromClaudeCode()
|
|
90
|
+
|
|
53
91
|
process.stdout.write('Verboo Code instalado com sucesso!\n')
|
|
54
92
|
process.stdout.write('Para começar, digite verboo no seu terminal.\n')
|