Made changes to script

I renamed the file to reflect that it is only for MinGW (I plan to create
similar scripts for other operating systems), and added code to zip the release folder,
inside the shell script.
This commit is contained in:
2024-03-07 07:49:39 -05:00
parent 13ce75067b
commit 28c4b421d2

24
create_release_mingw.sh Normal file
View File

@@ -0,0 +1,24 @@
#!/bin/bash
# This script copies required DLLs, and the application itself into a folder called 'release'. It only runs on MinGW.
BASE_DIR=$(dirname $0)
REL_DIR="$BASE_DIR/release/dist"
mkdir -p "$REL_DIR"
# Parse the output of the 'ldd' command, and create a file with the required DLL paths.
ldd build/pong.exe | awk ' NF == 4 {print $3}' > "$BASE_DIR/tmp_file.txt"
# Copy the required DLLs.
cp $(cat "$BASE_DIR/tmp_file.txt") "$REL_DIR"
# Copy the executable itself
cp "$BASE_DIR/build/pong" "$REL_DIR"
# Remove the temporary file.
rm "$BASE_DIR/tmp_file.txt"
#Zip the $REL_DIR folder
zip -r "$BASE_DIR/release/netpong-win.zip" "$REL_DIR"