hosted mode create /var/lib/miaou-bash/semver_current
This commit is contained in:
+7
-4
@@ -96,13 +96,16 @@ function _pluralize_simple {
|
||||
|
||||
function fetch_distro_like {
|
||||
if grep -qE '^ID=debian|^ID_LIKE=debian' /etc/os-release; then
|
||||
echo debian
|
||||
DISTRO_LIKE=debian
|
||||
elif grep -qE '^ID=arch|^ID_LIKE=arch' /etc/os-release; then
|
||||
echo arch
|
||||
DISTRO_LIKE=arch
|
||||
else
|
||||
echo -n 'unsupported distro: '
|
||||
grep ^ID= /etc/os-release | cut -d= -f2
|
||||
local unsupported_distro
|
||||
unsupported_distro=$(grep ^ID= /etc/os-release | cut -d= -f2)
|
||||
>&2 echo -n "MIAOU ERROR: unsupported distro: $unsupported_distro"
|
||||
return 99
|
||||
fi
|
||||
export DISTRO_LIKE
|
||||
}
|
||||
|
||||
function _confirm_destructive {
|
||||
|
||||
+11
-1
@@ -219,12 +219,19 @@ function launch_hooks {
|
||||
done
|
||||
}
|
||||
|
||||
function apply_mode {
|
||||
if [[ "$MIAOU_BASH_MODE" == hosted ]]; then
|
||||
sudo mkdir /var/lib/miaou-bash -p
|
||||
sudo cp "$MIAOU_BASH_DIR"/.semver_git_tag /var/lib/miaou-bash/semver_current
|
||||
fi
|
||||
}
|
||||
|
||||
# MAIN
|
||||
|
||||
source "$MIAOU_BASH_DIR"/lib/functions.bash
|
||||
|
||||
assert_root
|
||||
DISTRO_LIKE=$(fetch_distro_like)
|
||||
fetch_distro_like
|
||||
install_required_packages
|
||||
fix_users_bashrc
|
||||
fix_terminfo_ghostty
|
||||
@@ -232,4 +239,7 @@ ghostty_global_config
|
||||
link_config_files
|
||||
link_miaou_bash
|
||||
create_sudoers
|
||||
|
||||
fetch_mode
|
||||
apply_mode
|
||||
launch_hooks
|
||||
|
||||
Reference in New Issue
Block a user