gm-kilo 2.0.170 → 2.0.171
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.
|
@@ -108,7 +108,13 @@ const run = () => {
|
|
|
108
108
|
try {
|
|
109
109
|
let result;
|
|
110
110
|
if (lang === 'bash' || lang === 'cmd') {
|
|
111
|
-
|
|
111
|
+
const shFile = path.join(os.tmpdir(), `gm-exec-${Date.now()}.ps1`);
|
|
112
|
+
fs.writeFileSync(shFile, code, 'utf-8');
|
|
113
|
+
result = spawnDirect('powershell', ['-NoProfile', '-NonInteractive', '-File', shFile]);
|
|
114
|
+
try { fs.unlinkSync(shFile); } catch (e) {}
|
|
115
|
+
if (!result || result.startsWith('[spawn error:')) {
|
|
116
|
+
result = runExec(['x', 'gm-exec', 'bash', ...(cwd ? [`--cwd=${cwd}`] : []), code]);
|
|
117
|
+
}
|
|
112
118
|
} else if (lang === 'python' || lang === 'py') {
|
|
113
119
|
result = spawnDirect('python3', ['-c', code]);
|
|
114
120
|
if (!result || result.startsWith('[spawn error:')) result = spawnDirect('python', ['-c', code]);
|