diff options
author | Gavin Howard <gavin@yzena.com> | 2021-08-08 20:49:02 -0600 |
---|---|---|
committer | Gavin Howard <gavin@yzena.com> | 2021-08-08 20:49:02 -0600 |
commit | 648f43d4d3475b69a22b605f5e3a24a7567423d3 (patch) | |
tree | 8a7f27ee6aab62e7530e84836ea744b31c38cd5c | |
parent | c81ca81dae3714d6c565336452dc5938f470aa3b (diff) | |
download | bc-648f43d4d3475b69a22b605f5e3a24a7567423d3.tar.gz |
Harden scripts/package.sh
Signed-off-by: Gavin Howard <gavin@yzena.com>
-rwxr-xr-x | scripts/package.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/scripts/package.sh b/scripts/package.sh index 98727d01..e1210137 100755 --- a/scripts/package.sh +++ b/scripts/package.sh @@ -40,6 +40,7 @@ # * sha256sum # * gpg # * zip +# * unzip shasum() { @@ -83,6 +84,11 @@ proj="bc" cd "$repo" +if [ ! -f "../Debug.zig" ] || [ ! -f "../Release.zip" ]; then + printf 'Must have Windows builds!\n' + exit 1 +fi + # We want the absolute path for later. repo=$(pwd) @@ -182,6 +188,7 @@ mv "$projver.tar.xz" "$parent" cd "$parent" +# Clean up old Windows stuff. if [ -d Win32_Debug ]; then rm -rf Win32_Debug fi @@ -198,6 +205,15 @@ if [ -d Win64_Release ]; then rm -rf Win64_Release fi +# Prepare Windows stuff. +if [ ! -d Debug ]; then + unzip Debug.zip +fi + +if [ ! -d Release ]; then + unzip Release.zip +fi + # Zip the Windows stuff. mkdir Win32_Debug cp Debug/Win32/bc/bc.exe Win32_Debug |