Skip to content

Commit

Permalink
Refine lang setting (#1778)
Browse files Browse the repository at this point in the history
[deploy]
  • Loading branch information
jsa34 authored Jan 31, 2023
1 parent 7e17a2d commit ed21a2b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 16 deletions.
19 changes: 11 additions & 8 deletions NodeChrome/wrap_chrome_binary
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,24 @@ WRAPPER_PATH=$(readlink -f /usr/bin/google-chrome)
BASE_PATH="$WRAPPER_PATH-base"
mv "$WRAPPER_PATH" "$BASE_PATH"

# Debian/Ubuntu seems to not respect --lang, it instead needs to be a LANGUAGE environment var
# See: https://stackoverflow.com/a/41893197/359999
for var in "$@"; do
if [[ $var == --lang=* ]]; then
LANGUAGE=${var//--lang=}
fi
done

cat > "$WRAPPER_PATH" <<_EOF
#!/bin/bash
# umask 002 ensures default permissions of files are 664 (rw-rw-r--) and directories are 775 (rwxrwxr-x).
umask 002
# Set language environment variable
export LANGUAGE="$LANGUAGE"
# Note: exec -a below is a bashism.
exec -a "\$0" "$BASE_PATH" --no-sandbox "\$@"
_EOF
chmod +x "$WRAPPER_PATH"

# Debian/Ubuntu seems to not respect --lang, it instead needs to be a LANGUAGE environment var
# See: https://stackoverflow.com/a/41893197/359999
for var in "$@"; do
if [[ $var == --lang=* ]]; then
export LANGUAGE=${var//--lang=}
fi
done
19 changes: 11 additions & 8 deletions NodeEdge/wrap_edge_binary
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,24 @@ WRAPPER_PATH=$(readlink -f /usr/bin/microsoft-edge)
BASE_PATH="$WRAPPER_PATH-base"
mv "$WRAPPER_PATH" "$BASE_PATH"

# Debian/Ubuntu seems to not respect --lang, it instead needs to be a LANGUAGE environment var
# See: https://stackoverflow.com/a/41893197/359999
for var in "$@"; do
if [[ $var == --lang=* ]]; then
LANGUAGE=${var//--lang=}
fi
done

cat > "$WRAPPER_PATH" <<_EOF
#!/bin/bash
# umask 002 ensures default permissions of files are 664 (rw-rw-r--) and directories are 775 (rwxrwxr-x).
umask 002
# Set language environment variable
export LANGUAGE="$LANGUAGE"
# Note: exec -a below is a bashism.
exec -a "\$0" "$BASE_PATH" --no-sandbox "\$@"
_EOF
chmod +x "$WRAPPER_PATH"

# Debian/Ubuntu seems to not respect --lang, it instead needs to be a LANGUAGE environment var
# See: https://stackoverflow.com/a/41893197/359999
for var in "$@"; do
if [[ $var == --lang=* ]]; then
export LANGUAGE=${var//--lang=}
fi
done

0 comments on commit ed21a2b

Please sign in to comment.