Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.then(stdout => {
const lcidCode = parseInt(stdout.replace('Locale', ''), 16);
return lcid.from(lcidCode);
});
}
function getWinLocaleSync() {
const stdout = execa.sync('wmic', ['os', 'get', 'locale']).stdout;
const lcidCode = parseInt(stdout.replace('Locale', ''), 16);
return lcid.from(lcidCode);
}
function getWinLocaleSync() {
const stdout = execa.sync('wmic', ['os', 'get', 'locale']).stdout;
const lcidCode = parseInt(stdout.replace('Locale', ''), 16);
return lcid.from(lcidCode);
}
function getWinLocaleSync() {
const {stdout} = execa.sync('wmic', ['os', 'get', 'locale']);
const lcidCode = parseInt(stdout.replace('Locale', ''), 16);
return lcid.from(lcidCode);
}
function getWinLocaleSync() {
const {stdout} = execa.sync('wmic', ['os', 'get', 'locale']);
const lcidCode = parseInt(stdout.replace('Locale', ''), 16);
return lcid.from(lcidCode);
}
.then(stdout => {
const lcidCode = parseInt(stdout.replace('Locale', ''), 16);
return lcid.from(lcidCode);
});
}
childProcess.execFile('wmic', ['os', 'get', 'locale'], function (err, stdout) {
if (err) {
fallback();
return;
}
var lcidCode = parseInt(stdout.replace('Locale', ''), 16);
cache = lcid.from(lcidCode) || fallback();
cb(null, cache);
});
} else {
if (cache || getEnvLocale() || !execFileSync || opts.spawn === false) {
return cache;
}
if (process.platform === 'win32') {
var stdout;
try {
stdout = execFileSync('wmic', ['os', 'get', 'locale'], {encoding: 'utf8'});
} catch (err) {
return fallback();
}
var lcidCode = parseInt(stdout.replace('Locale', ''), 16);
cache = lcid.from(lcidCode) || fallback();
return cache;
}
var res;
try {
res = parseLocale(execFileSync('locale', {encoding: 'utf8'}));
} catch (err) {}
if (!res && process.platform === 'darwin') {
try {
cache = execFileSync('defaults', ['read', '-g', 'AppleLocale'], {encoding: 'utf8'}).trim() || fallback();
return cache;
} catch (err) {
return fallback();
}