Skip to content
Permalink
Browse files

Calculate env vars when launching Atom from the desktop

  • Loading branch information...
rafeca committed Apr 11, 2019
1 parent b89fa55 commit 1a1468b61f8c8bea239bd9b7b57f29d7510ce502
Showing with 9 additions and 3 deletions.
  1. +5 −1 atom.sh
  2. +1 −1 resources/linux/atom.desktop.in
  3. +3 −1 src/update-process-env.js
@@ -24,7 +24,11 @@ case $(basename $0) in
;;
esac

export ATOM_DISABLE_SHELLING_OUT_FOR_ENVIRONMENT=true
# Only set the ATOM_DISABLE_SHELLING_OUT_FOR_ENVIRONMENT env var if it hasn't been set.
if [ -z "$ATOM_DISABLE_SHELLING_OUT_FOR_ENVIRONMENT" ]
then
export ATOM_DISABLE_SHELLING_OUT_FOR_ENVIRONMENT=true
fi

ATOM_ADD=false
ATOM_NEW_WINDOW=false
@@ -2,7 +2,7 @@
Name=<%= appName %>
Comment=<%= description %>
GenericName=Text Editor
Exec=<%= installDir %>/bin/<%= appFileName %> %F
Exec=env ATOM_DISABLE_SHELLING_OUT_FOR_ENVIRONMENT=false <%= installDir %>/bin/<%= appFileName %> %F
Icon=<%= iconPath %>
Type=Application
StartupNotify=true
@@ -51,7 +51,9 @@ function shouldGetEnvFromShell (env) {
return false
}

if (env.ATOM_DISABLE_SHELLING_OUT_FOR_ENVIRONMENT || process.env.ATOM_DISABLE_SHELLING_OUT_FOR_ENVIRONMENT) {
const disableSellingOut = env.ATOM_DISABLE_SHELLING_OUT_FOR_ENVIRONMENT || process.env.ATOM_DISABLE_SHELLING_OUT_FOR_ENVIRONMENT

if (disableSellingOut === 'true') {
return false
}

0 comments on commit 1a1468b

Please sign in to comment.
You can’t perform that action at this time.