sim-setup 1.0.64-preview.340.1 → 1.0.64-preview.341.1
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/dist/index.js +9 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3411,7 +3411,8 @@ function parseValue(raw) {
|
|
|
3411
3411
|
if (trimmed.startsWith('"') || trimmed.startsWith("'")) {
|
|
3412
3412
|
const quote = trimmed[0];
|
|
3413
3413
|
const end = trimmed.indexOf(quote, 1);
|
|
3414
|
-
|
|
3414
|
+
const inner = end === -1 ? trimmed.slice(1) : trimmed.slice(1, end);
|
|
3415
|
+
return quote === '"' ? inner.replaceAll("\\$", "$") : inner;
|
|
3415
3416
|
}
|
|
3416
3417
|
return trimmed.replace(/\s+#.*$/, "").trim();
|
|
3417
3418
|
}
|
|
@@ -3435,11 +3436,17 @@ function formatEnvValue(key, value) {
|
|
|
3435
3436
|
if (/[\r\n]/.test(value)) {
|
|
3436
3437
|
throw new Error(`${key} cannot be written to an environment file: it contains a line break`);
|
|
3437
3438
|
}
|
|
3439
|
+
if (value.includes("$")) {
|
|
3440
|
+
if (/["\\`]/.test(value)) {
|
|
3441
|
+
throw new Error(`${key} cannot be written to an environment file: it mixes $ with a double quote, backslash, or backtick`);
|
|
3442
|
+
}
|
|
3443
|
+
return `"${value.replaceAll("$", "\\$")}"`;
|
|
3444
|
+
}
|
|
3438
3445
|
if (value === value.trim() && !value.includes("#") && !/^["'`]/.test(value))
|
|
3439
3446
|
return value;
|
|
3440
3447
|
if (!value.includes("'"))
|
|
3441
3448
|
return `'${value}'`;
|
|
3442
|
-
if (!/["
|
|
3449
|
+
if (!/["\\`]/.test(value))
|
|
3443
3450
|
return `"${value}"`;
|
|
3444
3451
|
throw new Error(`${key} cannot be written to an environment file: it mixes quotes with a # or edge whitespace`);
|
|
3445
3452
|
}
|