codecane 1.0.395 → 1.0.396
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/package.json +15 -4
- package/scripts/codebuff-wrapper.js +1 -1
- package/scripts/install.js +11 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codecane",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.396",
|
|
4
4
|
"description": "AI dev assistant",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|
|
@@ -9,9 +9,20 @@
|
|
|
9
9
|
"scripts": {
|
|
10
10
|
"postinstall": "node scripts/install.js"
|
|
11
11
|
},
|
|
12
|
-
"files": [
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
"files": [
|
|
13
|
+
"scripts/codebuff-wrapper.js",
|
|
14
|
+
"scripts/install.js",
|
|
15
|
+
"README.md"
|
|
16
|
+
],
|
|
17
|
+
"os": [
|
|
18
|
+
"darwin",
|
|
19
|
+
"linux",
|
|
20
|
+
"win32"
|
|
21
|
+
],
|
|
22
|
+
"cpu": [
|
|
23
|
+
"x64",
|
|
24
|
+
"arm64"
|
|
25
|
+
],
|
|
15
26
|
"engines": {
|
|
16
27
|
"node": ">=16"
|
|
17
28
|
},
|
|
@@ -6,7 +6,7 @@ const os = require('os')
|
|
|
6
6
|
const { spawn } = require('child_process')
|
|
7
7
|
|
|
8
8
|
const homeDir = os.homedir()
|
|
9
|
-
const manicodeDir = path.join(homeDir, '.manicode')
|
|
9
|
+
const manicodeDir = path.join(homeDir, '.config', 'manicode')
|
|
10
10
|
const binaryName = process.platform === 'win32' ? 'codebuff.exe' : 'codebuff'
|
|
11
11
|
const binaryPath = path.join(manicodeDir, binaryName)
|
|
12
12
|
|
package/scripts/install.js
CHANGED
|
@@ -27,9 +27,9 @@ if (!file) {
|
|
|
27
27
|
|
|
28
28
|
const url = `https://github.com/CodebuffAI/codebuff-community/releases/download/v${ver}/${file}`
|
|
29
29
|
const homeDir = os.homedir()
|
|
30
|
-
const manicodeDir = path.join(homeDir, '.manicode')
|
|
30
|
+
const manicodeDir = path.join(homeDir, '.config', 'manicode')
|
|
31
31
|
|
|
32
|
-
// Create .manicode directory
|
|
32
|
+
// Create .config/manicode directory
|
|
33
33
|
fs.mkdirSync(manicodeDir, { recursive: true })
|
|
34
34
|
|
|
35
35
|
console.log(`⬇️ Downloading ${file} from GitHub releases...`)
|
|
@@ -81,11 +81,18 @@ function handleResponse(res) {
|
|
|
81
81
|
res.pipe(zlib.createGunzip())
|
|
82
82
|
.pipe(tar.extract({ cwd: manicodeDir }))
|
|
83
83
|
.on('finish', () => {
|
|
84
|
-
// Make executable
|
|
84
|
+
// Make executable and rename to standard name
|
|
85
85
|
const binaryName = platform === 'win32' ? 'codebuff.exe' : 'codebuff'
|
|
86
|
-
const
|
|
86
|
+
const extractedBinaryName = platform === 'win32' ? 'codebuff.exe' : 'codebuff'
|
|
87
|
+
const binaryPath = path.join(manicodeDir, extractedBinaryName)
|
|
88
|
+
const finalBinaryPath = path.join(manicodeDir, binaryName)
|
|
89
|
+
|
|
87
90
|
if (fs.existsSync(binaryPath)) {
|
|
88
91
|
fs.chmodSync(binaryPath, 0o755)
|
|
92
|
+
// Rename if necessary (though it should already be the correct name)
|
|
93
|
+
if (binaryPath !== finalBinaryPath) {
|
|
94
|
+
fs.renameSync(binaryPath, finalBinaryPath)
|
|
95
|
+
}
|
|
89
96
|
}
|
|
90
97
|
console.log('✅ codebuff installed')
|
|
91
98
|
})
|