Update compile.sh

- Add ability to compile multiple files thru args
This commit is contained in:
Shorohov Sergey 2019-09-06 15:25:07 +03:00 committed by GitHub
parent 0bd69445f9
commit a015692309
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,24 +1,20 @@
#!/bin/bash
# AMX Mod X
#
# by the AMX Mod X Development Team
# originally developed by OLO
#
# This file is part of AMX Mod X.
# new code contributed by \malex\
#!/bin/bash -e
cd "$(dirname "$0")"
test -e compiled || mkdir compiled
rm -f temp.txt
for sourcefile in *.sma
do
amxxfile="`echo $sourcefile | sed -e 's/\.sma$/.amxx/'`"
echo -n "Compiling $sourcefile ..."
./amxxpc $sourcefile -ocompiled/$amxxfile >> temp.txt
echo "done"
done
less temp.txt
rm temp.txt
if [[ $# -ne 0 ]]; then
for sourcefile in "$@"
do
amxxfile="`echo $sourcefile | sed -e 's/\.sma$/\.amxx/'`"
echo -e "\nCompiling $sourcefile..."
./amxxpc $sourcefile -ocompiled/$amxxfile
done
else
for sourcefile in *.sma
do
amxxfile="`echo $sourcefile | sed -e 's/\.sma$/\.amxx/'`"
echo -e "\nCompiling $sourcefile ..."
./amxxpc $sourcefile -ocompiled/$amxxfile
done
fi