Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let compile.sh compile just a single selected file, instead of compiling the whole directory #1114

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions plugins/compile.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
#!/bin/bash -e
cd "$(dirname "$0")"

# AMX Mod X
#
Expand All @@ -11,14 +12,23 @@

test -e compiled || mkdir compiled
rm -f temp.txt

for sourcefile in *.sma
do
if [[ $# -ne 0 ]]; then
for sourcefile in "$@"
do
amxxfile="`echo $sourcefile | sed -e 's/\.sma$/.amxx/'`"
echo -n "Compiling $sourcefile ..."
./amxxpc $sourcefile -ocompiled/$amxxfile >> temp.txt
echo "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
done
fi

less temp.txt
rm temp.txt