mirror of
https://codeberg.org/spire/spcomp.git
synced 2026-06-03 16:44:08 +02:00
output fixes?
This commit is contained in:
parent
1320d078e1
commit
d67ca5aa29
1 changed files with 17 additions and 12 deletions
29
spcomp.sh
29
spcomp.sh
|
|
@ -4,16 +4,10 @@ if [ -e "/include/*" ]; then
|
||||||
cp /include/* /scripting/include
|
cp /include/* /scripting/include
|
||||||
fi
|
fi
|
||||||
|
|
||||||
IN=$@
|
BASEDIR="$(pwd)"
|
||||||
cd $(dirname $IN)
|
|
||||||
|
|
||||||
IN="$(basename $IN)"
|
IN=$*
|
||||||
OUT="${IN%.sp}.smx"
|
OUT="$(basename "${IN%.sp}".smx)"
|
||||||
|
|
||||||
if [ "$IN" -ot "$OUT" ]; then
|
|
||||||
echo "Compiled file already up to date"
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -z "$OUTPUT" ]; then
|
if [ ! -z "$OUTPUT" ]; then
|
||||||
if [ "$IN" -ot "$OUTPUT" ]; then
|
if [ "$IN" -ot "$OUTPUT" ]; then
|
||||||
|
|
@ -22,11 +16,20 @@ if [ ! -z "$OUTPUT" ]; then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
/scripting/spcomp $IN
|
cd "$(dirname "$IN")" || exit
|
||||||
|
|
||||||
|
IN="$(basename "$IN")"
|
||||||
|
|
||||||
|
if [ "$IN" -ot "$OUT" ]; then
|
||||||
|
echo "Compiled file already up to date"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
/scripting/spcomp "$IN"
|
||||||
|
|
||||||
OUT="${IN%.sp}.smx"
|
OUT="${IN%.sp}.smx"
|
||||||
|
|
||||||
chown $(stat -c '%u' $IN):$(stat -c '%g' $IN) $OUT
|
chown $(stat -c '%u' "$IN"):$(stat -c '%g' "$IN") "$OUT"
|
||||||
|
|
||||||
if [ -d "/output" ]; then
|
if [ -d "/output" ]; then
|
||||||
cp $OUT /output
|
cp $OUT /output
|
||||||
|
|
@ -34,5 +37,7 @@ fi
|
||||||
|
|
||||||
if [ ! -z "$OUTPUT" ]
|
if [ ! -z "$OUTPUT" ]
|
||||||
then
|
then
|
||||||
cp $OUT $OUTPUT
|
mv $OUT /tmp/out.smx
|
||||||
|
cd "$BASEDIR"
|
||||||
|
mv /tmp/out.smx $OUTPUT
|
||||||
fi
|
fi
|
||||||
Loading…
Add table
Add a link
Reference in a new issue