Rewrite of bash system

+ Implemented new dashboard menu
+ some fixes for db_assembler
+ new module installation process with version check via json files
+ some fixes to modules installer
+ implemented simple crossplatform worldserver and authserver restarters
+ new compiler script
+ client data downloader (beta)
+ various other fixes
This commit is contained in:
Yehonal
2018-07-15 22:40:49 +02:00
parent 07a451e140
commit 85388901cf
38 changed files with 2179 additions and 163 deletions

View File

@@ -1,5 +0,0 @@
#!/usr/bin/env bash
CURRENT_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
bash "$CURRENT_PATH/compiler.sh" 1

View File

@@ -1,5 +0,0 @@
#!/usr/bin/env bash
CURRENT_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
bash "$CURRENT_PATH/compiler.sh" 2

View File

@@ -1,5 +0,0 @@
#!/usr/bin/env bash
CURRENT_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
bash "$CURRENT_PATH/compiler.sh" 3

View File

@@ -4,41 +4,67 @@ 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
re='^[0-9]+$'
if [[ $1 =~ $re ]] && test "${comp_functions[$1-1]+'test'}"; then
${comp_functions[$1-1]}
elif [ -n "$(type -t comp_$1)" ] && [ "$(type -t comp_$1)" = function ]; then
fun="comp_$1"
$fun
else
echo "invalid option"
fi
echo "invalid option, use --help option for the commands list"
fi
}
comp_options=("Clean" "Configure" "Build" "All")
comp_functions=("comp_clean" "comp_configure" "comp_build" "all")
function comp_quit() {
exit 0
}
comp_options=(
"build: Configure and compile"
"clean: Clean build files"
"configure: Run CMake"
"compile: Compile only"
"all: clean, configure and compile"
"quit: Close this menu")
comp_functions=(
"comp_build"
"comp_clean"
"comp_configure"
"comp_compile"
"comp_all"
"comp_quit")
PS3='[ Please enter your choice ]: '
runHooks "ON_AFTER_OPTIONS" #you can create your custom options
# push exit after custom options
comp_options+=('Exit')
comp_functions+=('exit 0')
function _switch() {
_reply="$1"
_opt="$2"
# 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
case $_reply in
""|"--help")
echo "Available commands:"
printf '%s\n' "${options[@]}"
;;
*)
run_option $REPLY
run_option $_reply $_opt
;;
esac
}
while true
do
# run option directly if specified in argument
[ ! -z $1 ] && _switch $@
[ ! -z $1 ] && exit 0
select opt in "${comp_options[@]}"
do
echo "==== ACORE COMPILER ===="
_switch $REPLY
break;
done
done

View File

@@ -39,7 +39,7 @@ function comp_configure() {
}
function comp_build() {
function comp_compile() {
[ $MTHREADS == 0 ] && MTHREADS=`grep -c ^processor /proc/cpuinfo` && MTHREADS=$(($MTHREADS + 2))
echo "Using $MTHREADS threads"
@@ -55,3 +55,13 @@ function comp_build() {
runHooks "ON_AFTER_BUILD"
}
function comp_build() {
comp_configure
comp_build
}
function comp_all() {
comp_clean
comp_build
}