From 09233ea1b9b8562b2df46d1967ea12036e15b0b4 Mon Sep 17 00:00:00 2001 From: r6915ee Date: Mon, 15 Sep 2025 20:37:05 -0700 Subject: [PATCH 1/3] Use sh alternatives and fix change directory in building shell scripts The usage of the cd command in the shell scripts under building/ can conflict at some point during the procedure. As far as I'm aware, it's supposed to cd to the parent directory, but it does so strangely. On some occasions, this may cause the directory to switch to /tmp on Linux instead. This commit resolves that by instead using the typical .. syntax, which is a shorthand for the parent directory of the process. Additionally, proper shebangs have been added that instead use "/usr/bin/env sh", which returns the path to a suitable sh alternative: that is, the closest program that can be found using 'sh' in the name. This is one of the most recommended shebangs for a shell script, due to 'env' typically being in the exact same position. --- building/cne-unix.sh | 5 +++-- building/setup-unix.sh | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/building/cne-unix.sh b/building/cne-unix.sh index dfd56eb47..c7bd00ed9 100755 --- a/building/cne-unix.sh +++ b/building/cne-unix.sh @@ -1,2 +1,3 @@ -cd "$(dirname "$(cd "$(dirname "$0")" && pwd)")" -haxe -cp commandline -D analyzer-optimize --run Main $@ \ No newline at end of file +#!/usr/bin/env sh +cd .. +haxe -cp commandline -D analyzer-optimize --run Main $@ diff --git a/building/setup-unix.sh b/building/setup-unix.sh index 59a3e0e0e..86dfe3097 100755 --- a/building/setup-unix.sh +++ b/building/setup-unix.sh @@ -1,2 +1,3 @@ -cd "$(dirname "$(cd "$(dirname "$0")" && pwd)")" -haxe -cp commandline -D analyzer-optimize --run Main setup \ No newline at end of file +#!/usr/bin/env sh +cd .. +haxe -cp commandline -D analyzer-optimize --run Main setup From 4a9890386992b0d9ed249fce6274c876b2b9a890 Mon Sep 17 00:00:00 2001 From: r6915ee Date: Tue, 16 Sep 2025 20:30:50 -0700 Subject: [PATCH 2/3] Update cd in building shell scripts to use script relative path properly The two prior versions would use the working directory's own parent directory, not the script's. This commit simply makes it so that changing the directory in the script uses its directory's parent instead. --- building/cne-unix.sh | 2 +- building/setup-unix.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/building/cne-unix.sh b/building/cne-unix.sh index c7bd00ed9..0ca0532f8 100755 --- a/building/cne-unix.sh +++ b/building/cne-unix.sh @@ -1,3 +1,3 @@ #!/usr/bin/env sh -cd .. +cd "$(dirname "$0")/.." haxe -cp commandline -D analyzer-optimize --run Main $@ diff --git a/building/setup-unix.sh b/building/setup-unix.sh index 86dfe3097..ff714a6cf 100755 --- a/building/setup-unix.sh +++ b/building/setup-unix.sh @@ -1,3 +1,3 @@ #!/usr/bin/env sh -cd .. +cd "$(dirname "$0")/.." haxe -cp commandline -D analyzer-optimize --run Main setup From e4ad4a1693a32d2c4c41e82c229a970408786422 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=8D=9A=7ENex?= <87421482+NexIsDumb@users.noreply.github.com> Date: Sun, 21 Sep 2025 17:17:05 +0200 Subject: [PATCH 3/3] dont mind me --- building/cne-unix.sh | 2 +- building/setup-unix.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/building/cne-unix.sh b/building/cne-unix.sh index 0ca0532f8..48ef1ca27 100755 --- a/building/cne-unix.sh +++ b/building/cne-unix.sh @@ -1,3 +1,3 @@ #!/usr/bin/env sh cd "$(dirname "$0")/.." -haxe -cp commandline -D analyzer-optimize --run Main $@ +haxe -cp commandline -D analyzer-optimize --run Main $@ \ No newline at end of file diff --git a/building/setup-unix.sh b/building/setup-unix.sh index ff714a6cf..fbbffe522 100755 --- a/building/setup-unix.sh +++ b/building/setup-unix.sh @@ -1,3 +1,3 @@ #!/usr/bin/env sh cd "$(dirname "$0")/.." -haxe -cp commandline -D analyzer-optimize --run Main setup +haxe -cp commandline -D analyzer-optimize --run Main setup \ No newline at end of file