Refactor resource gen script
This commit is contained in:
parent
351fe85e2f
commit
7a8087e8a1
@ -1,39 +1,37 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# I hate this.
|
||||
|
||||
linker="x86_64-w64-mingw32-ld"
|
||||
|
||||
# Output config (terrible)
|
||||
if [ "x$1" = "x--header" ]; then
|
||||
gen_header=1
|
||||
shift
|
||||
fi
|
||||
|
||||
if [ "x$1" = "x--object" ]; then
|
||||
gen_object=1
|
||||
shift
|
||||
fi
|
||||
# Select output types
|
||||
for i in {0..1}
|
||||
do
|
||||
case "$1" in
|
||||
--header)
|
||||
gen_header=1
|
||||
shift
|
||||
;;
|
||||
--object)
|
||||
gen_object=1
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Read project directory
|
||||
proj_dir=`realpath "$1"`
|
||||
shift
|
||||
|
||||
# Read output file destinations
|
||||
# Read output file destinations and make sure they don't exist
|
||||
if [ "x${gen_object}" = "x1" ]; then
|
||||
resources_o=`realpath "$1"`
|
||||
shift
|
||||
|
||||
rm -f "${resources_h}"
|
||||
fi
|
||||
if [ "x${gen_header}" = "x1" ]; then
|
||||
resources_h=`realpath "$1"`
|
||||
shift
|
||||
fi
|
||||
|
||||
# Make sure that output files do not exist
|
||||
if [ "x${gen_header}" = "x1" ]; then
|
||||
rm -f "${resources_h}"
|
||||
fi
|
||||
if [ "x${gen_object}" = "x1" ]; then
|
||||
rm -f "${resources_o}"
|
||||
fi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user