sapphire/sapphire.sh
2022-08-03 14:55:04 +00:00

25 lines
845 B
Bash
Executable File

#!/usr/bin/env sh
cd $(dirname $0)
usage()
{
echo "Sapphire utility script"
echo "-----------------------"
echo "sapphire.sh build <config>: build the project"
echo "sapphire.sh generate <generator> <config>: regenerate build files"
echo "sapphire.sh format: run clang-format on source files"
echo "sapphire.sh clean: clean build files"
echo "sapphire.sh install <path>: install the project"
echo "sapphire.sh new-ast-node <name>: create a new AST node"
}
case $1 in
"build") tools/build.sh "$2";;
"generate") tools/generate.sh "$2" "$3";;
"format") tools/format.sh;;
"clean") rm -rf build;;
"install") tools/install.sh "$2";;
"new-ast-node") tools/generateASTNode.sh $2;;
"help") usage;;
*) echo "Invalid action, run './sapphire.sh help' for a list of available options.";;
esac