-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
os-locale: Include 'preferLocal: false' option when using execa
Thanks to Rich Mirch for pointing this out.
- Loading branch information
1 parent
991d7f9
commit 2da39cc
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
diff --git a/node_modules/os-locale/index.js b/node_modules/os-locale/index.js | ||
index 1ada7a4..1304aa1 100644 | ||
--- a/node_modules/os-locale/index.js | ||
+++ b/node_modules/os-locale/index.js | ||
@@ -25,11 +25,11 @@ function getLocale(str) { | ||
} | ||
|
||
function getAppleLocale() { | ||
- return execa.stdout('defaults', ['read', '-g', 'AppleLocale']); | ||
+ return execa.stdout('defaults', ['read', '-g', 'AppleLocale'], { preferLocal: false }); | ||
} | ||
|
||
function getAppleLocaleSync() { | ||
- return execa.sync('defaults', ['read', '-g', 'AppleLocale']).stdout; | ||
+ return execa.sync('defaults', ['read', '-g', 'AppleLocale'], { preferLocal: false }).stdout; | ||
} | ||
|
||
function getUnixLocale() { | ||
@@ -37,7 +37,8 @@ function getUnixLocale() { | ||
return getAppleLocale(); | ||
} | ||
|
||
- return execa.stdout('locale') | ||
+ const args = null; | ||
+ return execa.stdout('locale', args, { preferLocal: false }) | ||
.then(stdout => getLocale(parseLocale(stdout))); | ||
} | ||
|
||
@@ -50,7 +51,7 @@ function getUnixLocaleSync() { | ||
} | ||
|
||
function getWinLocale() { | ||
- return execa.stdout('wmic', ['os', 'get', 'locale']) | ||
+ return execa.stdout('wmic', ['os', 'get', 'locale'], { preferLocal: false }) | ||
.then(stdout => { | ||
const lcidCode = parseInt(stdout.replace('Locale', ''), 16); | ||
return lcid.from(lcidCode); | ||
@@ -58,7 +59,7 @@ function getWinLocale() { | ||
} | ||
|
||
function getWinLocaleSync() { | ||
- const stdout = execa.sync('wmic', ['os', 'get', 'locale']).stdout; | ||
+ const stdout = execa.sync('wmic', ['os', 'get', 'locale'], { preferLocal: false }).stdout; | ||
const lcidCode = parseInt(stdout.replace('Locale', ''), 16); | ||
return lcid.from(lcidCode); | ||
} |