mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Sanitize compiler name for environment variables (#10270)
While strictly speaking more characters are allowed, they are not usable in a shell except for uppercase / digits / underscore. ( https://stackoverflow.com/a/2821183 )
This commit is contained in:
committed by
Ben Newman
parent
f8e59735f6
commit
05ae386b79
@@ -13,7 +13,9 @@ CachingCompilerBase = class CachingCompilerBase {
|
||||
}) {
|
||||
this._compilerName = compilerName;
|
||||
this._maxParallelism = maxParallelism;
|
||||
const envVarPrefix = 'METEOR_' + compilerName.toUpperCase() + '_CACHE_';
|
||||
const compilerNameForEnvar = compilerName.toUpperCase()
|
||||
.replace('/-/g', '_').replace(/[^A-Z0-9_]/g, '');
|
||||
const envVarPrefix = 'METEOR_' + compilerNameForEnvar + '_CACHE_';
|
||||
|
||||
const debugEnvVar = envVarPrefix + 'DEBUG';
|
||||
this._cacheDebugEnabled = !! process.env[debugEnvVar];
|
||||
|
||||
Reference in New Issue
Block a user