code-context-graph 0.5.2 → 0.5.3
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/install.js +11 -3
- package/package.json +1 -1
package/install.js
CHANGED
|
@@ -15,7 +15,7 @@ const PLATFORMS = {
|
|
|
15
15
|
"darwin-x64": "ccg-darwin-amd64",
|
|
16
16
|
"linux-x64": "ccg-linux-amd64",
|
|
17
17
|
"linux-arm64": "ccg-linux-arm64",
|
|
18
|
-
"win32-x64": "ccg-windows-amd64",
|
|
18
|
+
"win32-x64": "ccg-windows-amd64", // This is the zip name, the file inside is .exe
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
function getPlatformKey() {
|
|
@@ -82,7 +82,9 @@ async function install() {
|
|
|
82
82
|
|
|
83
83
|
try {
|
|
84
84
|
const data = await download(url);
|
|
85
|
-
fs.
|
|
85
|
+
if (!fs.existsSync(binDir)) {
|
|
86
|
+
fs.mkdirSync(binDir, { recursive: true });
|
|
87
|
+
}
|
|
86
88
|
|
|
87
89
|
if (isWindows) {
|
|
88
90
|
// Write zip and extract
|
|
@@ -90,6 +92,12 @@ async function install() {
|
|
|
90
92
|
fs.writeFileSync(zipPath, data);
|
|
91
93
|
execSync(`powershell -Command "Expand-Archive -Path '${zipPath}' -DestinationPath '${binDir}' -Force"`, { stdio: "ignore" });
|
|
92
94
|
fs.unlinkSync(zipPath);
|
|
95
|
+
|
|
96
|
+
// In Windows, the file inside ccg-windows-amd64.zip is ccg-windows-amd64.exe
|
|
97
|
+
const extracted = path.join(binDir, `${binaryName}.exe`);
|
|
98
|
+
if (fs.existsSync(extracted) && extracted !== binPath) {
|
|
99
|
+
fs.renameSync(extracted, binPath);
|
|
100
|
+
}
|
|
93
101
|
} else {
|
|
94
102
|
// Write tar.gz and extract
|
|
95
103
|
const tarPath = path.join(binDir, "ccg.tar.gz");
|
|
@@ -97,7 +105,7 @@ async function install() {
|
|
|
97
105
|
execSync(`tar xzf "${tarPath}" -C "${binDir}"`, { stdio: "ignore" });
|
|
98
106
|
fs.unlinkSync(tarPath);
|
|
99
107
|
|
|
100
|
-
// Rename platform-specific binary to 'ccg'
|
|
108
|
+
// Rename platform-specific binary to 'ccg' (e.g., ccg-darwin-arm64 -> ccg)
|
|
101
109
|
const extracted = path.join(binDir, binaryName);
|
|
102
110
|
if (fs.existsSync(extracted) && extracted !== binPath) {
|
|
103
111
|
fs.renameSync(extracted, binPath);
|
package/package.json
CHANGED