summaryrefslogtreecommitdiff
path: root/apps/compiler/compiler.sh
diff options
context:
space:
mode:
authorYehonal <yehonal.azeroth@gmail.com>2017-10-12 20:00:52 +0200
committerYehonal <yehonal.azeroth@gmail.com>2017-10-12 20:00:52 +0200
commitf06f32849f1e2c72dc73287c73361174c07ed29e (patch)
tree70ace68e849cd5ca446fb36279f8125127bb8693 /apps/compiler/compiler.sh
parent4df28fd29c6978e669f9950bd38e853fabf9fc8d (diff)
Directory Structure [step 1]: moving files
working on #672 NOTE: This commit can't be compiled!!
Diffstat (limited to 'apps/compiler/compiler.sh')
-rw-r--r--apps/compiler/compiler.sh44
1 files changed, 44 insertions, 0 deletions
diff --git a/apps/compiler/compiler.sh b/apps/compiler/compiler.sh
new file mode 100644
index 0000000000..cb89bfb705
--- /dev/null
+++ b/apps/compiler/compiler.sh
@@ -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