@@ -32533,6 +32533,10 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
3253332533const core_1 = __nccwpck_require__(2186);
3253432534const params_1 = __nccwpck_require__(5966);
3253532535const child_process_1 = __nccwpck_require__(2081);
32536+ const escapeShellValue = (value) => {
32537+ // Escape special characters that could cause shell interpretation issues
32538+ return value.replace(/(["\\'$`!])/g, '\\$1');
32539+ };
3253632540const run = () => __awaiter(void 0, void 0, void 0, function* () {
3253732541 try {
3253832542 const { additionalAppBinaryIds, additionalAppFiles, androidApiLevel, androidDevice, apiKey, apiUrl, appBinaryId, appFilePath, async, deviceLocale, downloadArtifacts, env, excludeFlows, excludeTags, googlePlay, includeTags, iOSVersion, iosDevice, maestroVersion, name, orientation, retry, workspaceFolder, } = yield (0, params_1.getParameters)();
@@ -32563,16 +32567,21 @@ const run = () => __awaiter(void 0, void 0, void 0, function* () {
3256332567 let paramsString = Object.keys(params).reduce((acc, key) => {
3256432568 if (!params[key])
3256532569 return acc;
32566- const needsQuotes = typeof params[key] === 'string' &&
32567- '"' !== params[key][0] &&
32568- params[key].includes(' ');
32569- const value = needsQuotes ? `"${params[key]}"` : params[key];
32570- return `${acc} --${key} ${value}`;
32570+ const value = typeof params[key] === 'string'
32571+ ? escapeShellValue(params[key])
32572+ : params[key];
32573+ const needsQuotes = typeof value === 'string' &&
32574+ !value.startsWith('"') &&
32575+ (value.includes(' ') || value.includes('\\'));
32576+ const finalValue = needsQuotes ? `"${value}"` : value;
32577+ return `${acc} --${key} ${finalValue}`;
3257132578 }, '');
3257232579 if (env && env.length > 0) {
3257332580 env.forEach((e) => {
3257432581 let [key, value] = e.split('=');
32575- const needsQuotes = '"' !== value[0] && value.includes(' ');
32582+ value = escapeShellValue(value);
32583+ const needsQuotes = !value.startsWith('"') &&
32584+ (value.includes(' ') || value.includes('\\'));
3257632585 if (needsQuotes)
3257732586 value = `"${value}"`;
3257832587 paramsString += ` --env ${key}=${value}`;
0 commit comments