Skip to content

Commit

Permalink
Merge pull request #15 from dscho/configure-locale
Browse files Browse the repository at this point in the history
Ensure that a locale is configured
  • Loading branch information
dscho authored Feb 24, 2021
2 parents 8e357ea + deff42f commit d1736c9
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,6 @@ jobs:
gcc -o hello-world.exe hello-world.c
hello="$(./hello-world.exe)"
test 'Hello, world!' = "$hello"
# Verify that the locale is set, enabling `grep -P` to work
test 123 = "$(printf '1248\n123\n' | grep -P '2(?!4)')"
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{
"cSpell.ignoreRegExpList": [
"CHERE_INVOKING",
"LC_CTYPE",
"SDK's",
"makepkg-git",
"mingw-w64-git",
"mingw32",
"mingw64",
"vstfs://.*"
],
Expand Down
5 changes: 5 additions & 0 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ async function run(): Promise<void> {
const msystem = architecture === 'i686' ? 'MINGW32' : 'MINGW64'
core.addPath(`${outputDirectory}/${msystem.toLocaleLowerCase()}/bin`)
core.exportVariable('MSYSTEM', msystem)
if (
!('LANG' in process.env) &&
!('LC_ALL' in process.env) &&
!('LC_CTYPE' in process.env)
) {
core.exportVariable('LC_CTYPE', 'C.UTF-8')
}
} catch (error) {
core.setFailed(error.message)
}
Expand Down

0 comments on commit d1736c9

Please sign in to comment.