devmode
This commit is contained in:
+15
-9
@@ -18,20 +18,26 @@ function bootstrap {
|
||||
fi
|
||||
echo "miaou-bash refreshed from: $MIAOU_BASH_DIR"
|
||||
}
|
||||
# MAIN
|
||||
|
||||
[[ "$UID" -ne 0 ]] && echo 'root privilege required' && exit 1
|
||||
current=$(miaou-bash --version)
|
||||
latest=$("$MIAOU_BASH_DIR/tools/wget_semver" artcode miaou/miaou-bash)
|
||||
|
||||
if [[ "$current" == "$latest" ]]; then
|
||||
echo "up-to-date version: $current"
|
||||
else
|
||||
# TODO: prevent refresh from development purpose
|
||||
function self_upgrade {
|
||||
rm -rf "$MIAOU_BASH_DIR"
|
||||
bootstrap
|
||||
|
||||
. "$MIAOU_BASH_DIR/lib/init.bash"
|
||||
echo "miaou-bash successfully updated"
|
||||
miaou-bash --version
|
||||
}
|
||||
|
||||
# MAIN
|
||||
|
||||
source "$MIAOU_BASH_DIR"/lib/functions.bash
|
||||
assert_system_mode
|
||||
assert_root
|
||||
|
||||
current=$(miaou-bash --version)
|
||||
latest=$("$MIAOU_BASH_DIR/tools/wget_semver" artcode miaou/miaou-bash)
|
||||
if [[ "$current" == "$latest" ]]; then
|
||||
echo "up-to-date version: $current"
|
||||
else
|
||||
self_upgrade
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user