summaryrefslogtreecommitdiff
path: root/bin/compiler/compiler.sh
diff options
context:
space:
mode:
authorShinDarth <borzifrancesco@gmail.com>2016-08-07 14:55:21 +0200
committerShinDarth <borzifrancesco@gmail.com>2016-08-07 14:55:21 +0200
commita7a81f90b191aeabebc768ff18807abf6d655a0c (patch)
tree369c1e94a8270ac4a5ea60cfa14243bb6866f043 /bin/compiler/compiler.sh
parentb96f058c175657aa85047f4200196bdd952c9888 (diff)
parent1fcfb9af5a0a8e4d308ec2ccda20adab99dce3ec (diff)
Merge branch 'master' into git
Diffstat (limited to 'bin/compiler/compiler.sh')
-rwxr-xr-xbin/compiler/compiler.sh43
1 files changed, 43 insertions, 0 deletions
diff --git a/bin/compiler/compiler.sh b/bin/compiler/compiler.sh
new file mode 100755
index 0000000000..187a16ed14
--- /dev/null
+++ b/bin/compiler/compiler.sh
@@ -0,0 +1,43 @@
+#!/bin/bash
+CURRENT_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+
+source "$CURRENT_PATH/includes/includes.sh"
+
+function all() {
+ clean
+ configure
+ 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=("clean" "configure" "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