Skip to content

Commit 38946bd

Browse files
authored
make sure to source the .env from the same AppDir
fix for pkgforge-dev/gpu-screen-recorder-AppImage#20
1 parent 207dfe9 commit 38946bd

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

useful-tools/path-mapping-hardcoded.hook

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
# this script makes symnlinks to the hardcoded random dirs that were
44
# patched away when 'PATH_MAPPING_HARDCODED' is used with quick-sharun
55

6-
CURRENTDIR="${CURRENTDIR:-${SHARUN_DIR:-${APPDIR}}}"
7-
if [ -f "$CURRENTDIR"/.env ]; then
8-
. "$CURRENTDIR"/.env
6+
CURRENTDIR="$(cd "${0%/*}" && echo "$PWD")"
7+
8+
# Use relative path to make sure we pick the `.env` from the same AppDir
9+
if [ -f "$CURRENTDIR"/../.env ]; then
10+
. "$CURRENTDIR"/../.env
911
[ -n "$_tmp_bin" ] && ln -sfn "$CURRENTDIR"/bin /tmp/"$_tmp_bin"
1012
[ -n "$_tmp_lib" ] && ln -sfn "$CURRENTDIR"/lib /tmp/"$_tmp_lib"
1113
[ -n "$_tmp_share" ] && ln -sfn "$CURRENTDIR"/share /tmp/"$_tmp_share"

0 commit comments

Comments
 (0)