shoud-cli 3.0.5 → 3.0.7
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/shoud.js +9 -0
- package/package.json +1 -1
- package/src/tools/shell.js +2 -3
package/bin/shoud.js
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
// Force UTF-8 on Windows consoles so box-drawing chars render correctly
|
|
3
|
+
if (process.platform === 'win32') {
|
|
4
|
+
try {
|
|
5
|
+
require('child_process').execSync('chcp 65001 > nul', { stdio: 'ignore' });
|
|
6
|
+
} catch (_) {}
|
|
7
|
+
}
|
|
8
|
+
// Optional: ensure Node's stdout uses UTF-8
|
|
9
|
+
try { process.stdout.setDefaultEncoding('utf8'); } catch (_) {}
|
|
10
|
+
|
|
2
11
|
const pkg = require('../package.json');
|
|
3
12
|
const { program } = require('commander');
|
|
4
13
|
const chalk = require('chalk');
|
package/package.json
CHANGED
package/src/tools/shell.js
CHANGED
|
@@ -2,14 +2,13 @@ const { spawn } = require('child_process');
|
|
|
2
2
|
const os = require('os');
|
|
3
3
|
|
|
4
4
|
function getShell() {
|
|
5
|
-
if (os.platform() === 'win32') return '
|
|
5
|
+
if (os.platform() === 'win32') return 'cmd.exe';
|
|
6
6
|
return process.env.SHELL || '/bin/bash';
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
function getShellArgs(command) {
|
|
10
10
|
if (os.platform() === 'win32') {
|
|
11
|
-
|
|
12
|
-
return ['-NoProfile', '-Command', `& { ${escaped} } | Out-String -Width 4096`];
|
|
11
|
+
return ['/d', '/s', '/c', command];
|
|
13
12
|
}
|
|
14
13
|
return ['-c', command];
|
|
15
14
|
}
|