@rooode/dsh-suite 0.1.2 → 0.1.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/bin/cli.js +16 -14
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -33,6 +33,20 @@ function printBanner() {
|
|
|
33
33
|
`);
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
function quoteArg(arg) {
|
|
37
|
+
if (typeof arg !== 'string') return String(arg);
|
|
38
|
+
if (/^[a-zA-Z0-9_\-\.\:\/\\]+$/.test(arg)) return arg;
|
|
39
|
+
return JSON.stringify(arg);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function execDsh(args) {
|
|
43
|
+
const fullCommand = ['npx', ...args.map(quoteArg)].join(' ');
|
|
44
|
+
return spawn(fullCommand, {
|
|
45
|
+
stdio: 'inherit',
|
|
46
|
+
shell: true,
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
36
50
|
function copyFolderSync(src, dest) {
|
|
37
51
|
fs.mkdirSync(dest, { recursive: true });
|
|
38
52
|
const entries = fs.readdirSync(src, { withFileTypes: true });
|
|
@@ -211,13 +225,8 @@ if (subcommand === 'install' || rawArgs.includes('--install')) {
|
|
|
211
225
|
}
|
|
212
226
|
// 2. Handle 'plugin' or 'profile' pass-through commands
|
|
213
227
|
else if (subcommand === 'plugin' || subcommand === 'profile') {
|
|
214
|
-
const isWin = process.platform === 'win32';
|
|
215
|
-
const executable = isWin ? 'npx.cmd' : 'npx';
|
|
216
228
|
const passthroughArgs = ['@deepseek-ai/dsh', subcommand, ...remainingArgs];
|
|
217
|
-
const child =
|
|
218
|
-
stdio: 'inherit',
|
|
219
|
-
shell: false,
|
|
220
|
-
});
|
|
229
|
+
const child = execDsh(passthroughArgs);
|
|
221
230
|
child.on('exit', (code) => {
|
|
222
231
|
process.exit(code || 0);
|
|
223
232
|
});
|
|
@@ -234,20 +243,13 @@ else {
|
|
|
234
243
|
const modeName = subcommand.toUpperCase();
|
|
235
244
|
console.log(`\x1b[32m✨ Starting DeepSeek Harness in \x1b[1m${modeName}\x1b[22m mode with All-in-One Suite...\x1b[0m\n`);
|
|
236
245
|
|
|
237
|
-
const isWin = process.platform === 'win32';
|
|
238
|
-
const executable = isWin ? 'npx.cmd' : 'npx';
|
|
239
|
-
|
|
240
246
|
const dshArgs = [
|
|
241
247
|
'@deepseek-ai/dsh',
|
|
242
248
|
subcommand,
|
|
243
249
|
...remainingArgs,
|
|
244
250
|
];
|
|
245
251
|
|
|
246
|
-
const child =
|
|
247
|
-
stdio: 'inherit',
|
|
248
|
-
shell: false,
|
|
249
|
-
});
|
|
250
|
-
|
|
252
|
+
const child = execDsh(dshArgs);
|
|
251
253
|
child.on('exit', (code) => {
|
|
252
254
|
process.exit(code || 0);
|
|
253
255
|
});
|