Skip to content

Commit

Permalink
Make launcher script behave more nicely with big environments and env…
Browse files Browse the repository at this point in the history
…ironment vars with spaces.
  • Loading branch information
cro committed Oct 22, 2021
1 parent 98c4036 commit 3b91006
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/fvim-osx-launcher
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
#!/usr/bin/env bash
ENVVARS=""
set -f
IFS=$'\n'
for VAR in `$SHELL --login -c /usr/bin/env`
do
if [[ $VAR == *"="* ]]
then
ENVVARS="$ENVVARS $VAR"
if [[ $VAR == "PATH="* ]]
then
THISPATH=$VAR
else
ENVVARS="$ENVVARS $VAR"
fi
fi
done
# Put PATH at the beginning to workaround env size limitation
ENVVARS="$THISPATH $ENVVARS"
fvim_exe="$(dirname "$0")/FVim"
logger "FVim: Starting. env is: $ENVVARS"
logger "FVim: executable path is: $fvim_exe"
Expand Down

0 comments on commit 3b91006

Please sign in to comment.