From ef492203af565b04a4b7d1b8bcda1aed0642ba9e Mon Sep 17 00:00:00 2001 From: Charadon Date: Tue, 4 Oct 2022 13:06:35 -0400 Subject: distribute.sh: Added better 7zip detection, and fixed unbound variable error. --- distribute.sh | 6 +++--- 1 file 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 -- * -- cgit 1.4.1-2-gfad0