Skip to content

Instantly share code, notes, and snippets.

@moonexpr
Created January 17, 2023 15:22
Show Gist options
  • Select an option

  • Save moonexpr/48fb3e566cfb1075c649d0fd05fa4bd7 to your computer and use it in GitHub Desktop.

Select an option

Save moonexpr/48fb3e566cfb1075c649d0fd05fa4bd7 to your computer and use it in GitHub Desktop.
./spcomp64_and_deploy FILE - Compiles a SourcePawn file and places it in ../plugins
#!/usr/bin/bash
compiler="spcomp64"
declare -a opts
filename="$1"
if [[ -d include ]]; then
# Include path if found.
opts+="-i include "
fi
smxfile="`echo $1 | sed -e 's/\.sp$/\.smx/'`"
if [[ -f $1 && -d ../plugins ]]; then
# Output to plugins directory if possible.
opts+="-o./../plugins/$smxfile "
else
# Otherwise dump to current directory.
opts+="-o$smxfile "
fi
# Require semicolons
opts+="-; "
opts+="--use-stderr "
$compiler $opts $filename
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment