upgraded message

This commit is contained in:
pvincent
2026-08-11 19:58:38 +04:00
parent 1109281494
commit 94288f384e
2 changed files with 5 additions and 16 deletions
+2 -15
View File
@@ -1,29 +1,16 @@
#!/usr/bin/env miaou-bash
# CONSTANTS
#
[[ ! -v MAIN_TAR_GZ_URL ]] &&
readonly MAIN_TAR_GZ_URL="https://git.artcode.re/miaou/miaou-bash/archive/main.tar.gz"
# FUNCTIONS
function bootstrap {
cd "$(mktemp -d)" || exit 3
curl -s -O "$MAIN_TAR_GZ_URL"
tar -xzf main.tar.gz --directory "$(dirname "$MIAOU_BASH_DIR")"
local source_bin="$MIAOU_BASH_DIR/bin/miaou-bash"
local dest_bin="/usr/bin/miaou-bash"
if ! cmp -s "$source_bin" "$dest_bin"; then
cp -f "$source_bin" "$dest_bin"
fi
echo "miaou-bash refreshed from: $MIAOU_BASH_DIR"
}
function self_upgrade {
mv "$MIAOU_BASH_DIR" "$MIAOU_BASH_DIR".before_upgrade
"$MIAOU_BASH_DIR".before_upgrade/install.sh
"$MIAOU_BASH_DIR".before_upgrade/install.sh "upgraded"
rm -rf "$MIAOU_BASH_DIR".before_upgrade
echo "miaou-bash successfully updated"
. "$MIAOU_BASH_DIR"/bin/miaou-bash --version
}