openclaw-agent-dashboard 1.0.7 → 1.0.8
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/package.json +1 -1
- package/plugin/openclaw.plugin.json +1 -1
- package/plugin/package.json +1 -1
- package/scripts/lib/common.js +17 -3
package/package.json
CHANGED
package/plugin/package.json
CHANGED
package/scripts/lib/common.js
CHANGED
|
@@ -191,10 +191,24 @@ function shellEscape(arg) {
|
|
|
191
191
|
*/
|
|
192
192
|
function runCommand(cmd, args = [], options = {}) {
|
|
193
193
|
const { cwd, silent = true, timeout = 120000 } = options;
|
|
194
|
+
const isWin = process.platform === 'win32';
|
|
194
195
|
|
|
195
196
|
try {
|
|
196
|
-
//
|
|
197
|
-
const
|
|
197
|
+
// Windows 用双引号,Unix 用单引号
|
|
198
|
+
const esc = (arg) => {
|
|
199
|
+
if (!arg) return '""';
|
|
200
|
+
if (isWin) {
|
|
201
|
+
// Windows: 用双引号包裹含空格/特殊字符的路径
|
|
202
|
+
if (/[^a-zA-Z0-9_\-./:=@]/.test(arg)) {
|
|
203
|
+
return '"' + arg.replace(/"/g, '""') + '"';
|
|
204
|
+
}
|
|
205
|
+
return arg;
|
|
206
|
+
} else {
|
|
207
|
+
return shellEscape(arg);
|
|
208
|
+
}
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
const cmdStr = [cmd, ...args.map(esc)].join(' ');
|
|
198
212
|
|
|
199
213
|
const result = execSync(
|
|
200
214
|
cmdStr,
|
|
@@ -203,7 +217,7 @@ function runCommand(cmd, args = [], options = {}) {
|
|
|
203
217
|
encoding: 'utf8',
|
|
204
218
|
timeout,
|
|
205
219
|
stdio: silent ? ['ignore', 'pipe', 'pipe'] : 'inherit',
|
|
206
|
-
shell:
|
|
220
|
+
shell: true,
|
|
207
221
|
}
|
|
208
222
|
);
|
|
209
223
|
return { success: true, code: 0, output: result || '' };
|