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
+3 -1
View File
@@ -24,6 +24,8 @@ function assert_supported_distro {
set -Eeuo pipefail set -Eeuo pipefail
message="${1:-installed}"
[[ "$UID" -ne 0 ]] && echo 'root privilege required' && exit 1 [[ "$UID" -ne 0 ]] && echo 'root privilege required' && exit 1
! assert_supported_distro && echo 'unsupported distro: debian-like OR arch-like expected' && exit 2 ! assert_supported_distro && echo 'unsupported distro: debian-like OR arch-like expected' && exit 2
@@ -33,5 +35,5 @@ if [[ -d "$MIAOU_BASH_DIR" && -L /etc/inputrc && "$(readlink /etc/inputrc)" == "
else else
bootstrap bootstrap
. "$MIAOU_BASH_DIR"/bin/miaou-bash "$MIAOU_BASH_DIR/lib/init.bash" . "$MIAOU_BASH_DIR"/bin/miaou-bash "$MIAOU_BASH_DIR/lib/init.bash"
echo "miaou-bash successfully installed" echo "miaou-bash successfully $message"
fi fi
+2 -15
View File
@@ -1,29 +1,16 @@
#!/usr/bin/env miaou-bash #!/usr/bin/env miaou-bash
# CONSTANTS # CONSTANTS
#
[[ ! -v MAIN_TAR_GZ_URL ]] && [[ ! -v MAIN_TAR_GZ_URL ]] &&
readonly MAIN_TAR_GZ_URL="https://git.artcode.re/miaou/miaou-bash/archive/main.tar.gz" readonly MAIN_TAR_GZ_URL="https://git.artcode.re/miaou/miaou-bash/archive/main.tar.gz"
# FUNCTIONS # 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 { function self_upgrade {
mv "$MIAOU_BASH_DIR" "$MIAOU_BASH_DIR".before_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 rm -rf "$MIAOU_BASH_DIR".before_upgrade
echo "miaou-bash successfully updated"
. "$MIAOU_BASH_DIR"/bin/miaou-bash --version . "$MIAOU_BASH_DIR"/bin/miaou-bash --version
} }