about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCharadon <dev@iotib.net>2022-10-04 13:06:35 -0400
committerCharadon <dev@iotib.net>2022-10-04 13:06:35 -0400
commitef492203af565b04a4b7d1b8bcda1aed0642ba9e (patch)
tree73b4f6da10c437f27715d06b314efe9162c52cc2
parent27f4613a098f7a6a9ec74f125ad07b5310b558af (diff)
downloadPong-C-ef492203af565b04a4b7d1b8bcda1aed0642ba9e.tar.gz
distribute.sh: Added better 7zip detection, and fixed unbound variable error.
-rwxr-xr-xdistribute.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/distribute.sh b/distribute.sh
index 02c0369..a4f63d9 100755
--- a/distribute.sh
+++ b/distribute.sh
@@ -76,10 +76,10 @@ cd "$CONFIG_INSTALL_PREFIX"
 # Tarball the finish result!
 if [ "$WINDOWS" = "true" ];
 then
-	if [ -f "/c/Program Files/7-Zip/7z.exe" ];
+	ARCHIVE_NAME="Pong_$(uname -s)-$(uname -r)"
+	SEVENZIP="$(which 7z)" || SEVENZIP="/c/Program Files/7-Zip/7z.exe"
+	if [ -f "$SEVENZIP" ];
 	then # Try to use 7z's self extracting feature if possible.
-		ARCHIVE_NAME="Pong_$(uname -s)-$(uname -r)"
-		SEVENZIP="/c/Program Files/7-Zip/7z.exe"
 		"$SEVENZIP" a -sfx7z.sfx "$ARCHIVE_NAME".exe -- *
 	else # If not, just create a standard zip file.
 		zip -9 -r "$ARCHIVE_NAME".zip -- *