mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2024-12-25 06:15:37 +03:00
Let 'compile.sh' compile just a single selected file, instead of compiling the whole directory
Bring changes from SourceMod's "compile.sh"
This commit is contained in:
parent
27f451a868
commit
ea3f09f105
@ -1,4 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
# AMX Mod X
|
# AMX Mod X
|
||||||
#
|
#
|
||||||
@ -11,14 +12,23 @@
|
|||||||
|
|
||||||
test -e compiled || mkdir compiled
|
test -e compiled || mkdir compiled
|
||||||
rm -f temp.txt
|
rm -f temp.txt
|
||||||
|
if [[ $# -ne 0 ]]; then
|
||||||
for sourcefile in *.sma
|
for sourcefile in "$@"
|
||||||
do
|
do
|
||||||
amxxfile="`echo $sourcefile | sed -e 's/\.sma$/.amxx/'`"
|
amxxfile="`echo $sourcefile | sed -e 's/\.sma$/.amxx/'`"
|
||||||
echo -n "Compiling $sourcefile ..."
|
echo -n "Compiling $sourcefile ..."
|
||||||
./amxxpc $sourcefile -ocompiled/$amxxfile >> temp.txt
|
./amxxpc $sourcefile -ocompiled/$amxxfile >> temp.txt
|
||||||
echo "done"
|
echo "done"
|
||||||
done
|
done
|
||||||
|
else
|
||||||
|
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
|
||||||
|
fi
|
||||||
|
|
||||||
less temp.txt
|
less temp.txt
|
||||||
rm temp.txt
|
rm temp.txt
|
||||||
|
Loading…
Reference in New Issue
Block a user