This commit is contained in:
pvincent
2026-08-10 19:01:57 +04:00
parent 4ab03abf15
commit c883c0c36c
4 changed files with 42 additions and 21 deletions
+15 -9
View File
@@ -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