forked from olcxjas-softworks/LarpixClient
update electron to v43
This commit is contained in:
parent
68ac0beedf
commit
fb6c8b6ee9
5385 changed files with 513060 additions and 123058 deletions
28
electron/node_modules/app-builder-lib/out/util/envPath.js
generated
vendored
Normal file
28
electron/node_modules/app-builder-lib/out/util/envPath.js
generated
vendored
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.validateEnvValue = validateEnvValue;
|
||||
exports.resolveEnvToolsetPath = resolveEnvToolsetPath;
|
||||
const builder_util_1 = require("builder-util");
|
||||
const path = require("path");
|
||||
function validateEnvValue(envVarName) {
|
||||
const rawValue = process.env[envVarName];
|
||||
if ((0, builder_util_1.isEmptyOrSpaces)(rawValue)) {
|
||||
return null;
|
||||
}
|
||||
const trimmed = rawValue.trim();
|
||||
// On Windows, backslash is the native path separator and must not be rejected
|
||||
const shellUnsafeChars = process.platform === "win32" ? /[;&|`$<>"']/ : /[;&|`$<>"'\\]/;
|
||||
if (shellUnsafeChars.test(trimmed)) {
|
||||
throw new Error(`${envVarName} contains shell-unsafe characters: ${trimmed}`);
|
||||
}
|
||||
return trimmed;
|
||||
}
|
||||
function resolveEnvToolsetPath(envVarKey) {
|
||||
const value = validateEnvValue(envVarKey);
|
||||
if (value == null) {
|
||||
return null;
|
||||
}
|
||||
builder_util_1.log.info({ envVarKey, value }, `resolved value from environment variable`);
|
||||
return path.resolve(value);
|
||||
}
|
||||
//# sourceMappingURL=envPath.js.map
|
||||
Loading…
Add table
Add a link
Reference in a new issue