mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2025-11-29 17:38:24 +08:00
Directory Structure [step 1]: moving files
working on #672 NOTE: This commit can't be compiled!!
This commit is contained in:
44
apps/compiler/compiler.sh
Normal file
44
apps/compiler/compiler.sh
Normal file
@@ -0,0 +1,44 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
CURRENT_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
source "$CURRENT_PATH/includes/includes.sh"
|
||||
|
||||
function all() {
|
||||
comp_clean
|
||||
comp_configure
|
||||
comp_build
|
||||
}
|
||||
|
||||
function run_option() {
|
||||
if test "${comp_functions[$1-1]+'test'}"; then
|
||||
${comp_functions[$1-1]}
|
||||
else
|
||||
echo "invalid option"
|
||||
fi
|
||||
}
|
||||
|
||||
comp_options=("Clean" "Configure" "Build" "All")
|
||||
comp_functions=("comp_clean" "comp_configure" "comp_build" "all")
|
||||
|
||||
runHooks "ON_AFTER_OPTIONS" #you can create your custom options
|
||||
|
||||
# push exit after custom options
|
||||
comp_options+=('Exit')
|
||||
comp_functions+=('exit 0')
|
||||
|
||||
# run option directly if specified in argument
|
||||
[ ! -z $1 ] && run_option $1 && exit 0
|
||||
|
||||
PS3='[ Please enter your choice ]: '
|
||||
select opt in "${comp_options[@]}"
|
||||
do
|
||||
case $opt in
|
||||
'Exit')
|
||||
break
|
||||
;;
|
||||
*)
|
||||
run_option $REPLY
|
||||
;;
|
||||
esac
|
||||
done
|
||||
Reference in New Issue
Block a user