alurkerja-cli 1.0.8 → 1.0.10
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/index.js +32 -13
- package/index.js.backup +32 -13
- package/package.json +1 -1
- package/package.json.backup +1 -1
package/index.js
CHANGED
|
@@ -201,21 +201,40 @@ function getInstalledVersion() {
|
|
|
201
201
|
* Execute the Go binary with provided arguments
|
|
202
202
|
*/
|
|
203
203
|
function executeBinary(args) {
|
|
204
|
-
// For Windows (including MinGW/Git Bash), use shell mode for better compatibility
|
|
205
204
|
const isWindows = os.platform() === 'win32';
|
|
206
|
-
const child = spawn(BINARY_PATH, args, {
|
|
207
|
-
stdio: 'inherit',
|
|
208
|
-
shell: isWindows
|
|
209
|
-
});
|
|
210
|
-
|
|
211
|
-
child.on('error', (err) => {
|
|
212
|
-
console.error(`❌ Failed to execute binary: ${err.message}`);
|
|
213
|
-
process.exit(1);
|
|
214
|
-
});
|
|
215
205
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
206
|
+
// On Windows with shell mode, properly quote the binary path to handle spaces
|
|
207
|
+
if (isWindows) {
|
|
208
|
+
const quotedPath = `"${BINARY_PATH}"`;
|
|
209
|
+
const child = spawn(quotedPath, args, {
|
|
210
|
+
stdio: 'inherit',
|
|
211
|
+
shell: true
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
child.on('error', (err) => {
|
|
215
|
+
console.error(`❌ Failed to execute binary: ${err.message}`);
|
|
216
|
+
process.exit(1);
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
child.on('exit', (code) => {
|
|
220
|
+
process.exit(code || 0);
|
|
221
|
+
});
|
|
222
|
+
} else {
|
|
223
|
+
// Unix systems don't need quoting
|
|
224
|
+
const child = spawn(BINARY_PATH, args, {
|
|
225
|
+
stdio: 'inherit',
|
|
226
|
+
shell: false
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
child.on('error', (err) => {
|
|
230
|
+
console.error(`❌ Failed to execute binary: ${err.message}`);
|
|
231
|
+
process.exit(1);
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
child.on('exit', (code) => {
|
|
235
|
+
process.exit(code || 0);
|
|
236
|
+
});
|
|
237
|
+
}
|
|
219
238
|
}
|
|
220
239
|
|
|
221
240
|
/**
|
package/index.js.backup
CHANGED
|
@@ -201,21 +201,40 @@ function getInstalledVersion() {
|
|
|
201
201
|
* Execute the Go binary with provided arguments
|
|
202
202
|
*/
|
|
203
203
|
function executeBinary(args) {
|
|
204
|
-
// For Windows (including MinGW/Git Bash), use shell mode for better compatibility
|
|
205
204
|
const isWindows = os.platform() === 'win32';
|
|
206
|
-
const child = spawn(BINARY_PATH, args, {
|
|
207
|
-
stdio: 'inherit',
|
|
208
|
-
shell: isWindows
|
|
209
|
-
});
|
|
210
|
-
|
|
211
|
-
child.on('error', (err) => {
|
|
212
|
-
console.error(`❌ Failed to execute binary: ${err.message}`);
|
|
213
|
-
process.exit(1);
|
|
214
|
-
});
|
|
215
205
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
206
|
+
// On Windows with shell mode, properly quote the binary path to handle spaces
|
|
207
|
+
if (isWindows) {
|
|
208
|
+
const quotedPath = `"${BINARY_PATH}"`;
|
|
209
|
+
const child = spawn(quotedPath, args, {
|
|
210
|
+
stdio: 'inherit',
|
|
211
|
+
shell: true
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
child.on('error', (err) => {
|
|
215
|
+
console.error(`❌ Failed to execute binary: ${err.message}`);
|
|
216
|
+
process.exit(1);
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
child.on('exit', (code) => {
|
|
220
|
+
process.exit(code || 0);
|
|
221
|
+
});
|
|
222
|
+
} else {
|
|
223
|
+
// Unix systems don't need quoting
|
|
224
|
+
const child = spawn(BINARY_PATH, args, {
|
|
225
|
+
stdio: 'inherit',
|
|
226
|
+
shell: false
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
child.on('error', (err) => {
|
|
230
|
+
console.error(`❌ Failed to execute binary: ${err.message}`);
|
|
231
|
+
process.exit(1);
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
child.on('exit', (code) => {
|
|
235
|
+
process.exit(code || 0);
|
|
236
|
+
});
|
|
237
|
+
}
|
|
219
238
|
}
|
|
220
239
|
|
|
221
240
|
/**
|
package/package.json
CHANGED