update and refresh
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Print the logo
|
||||
print_logo() {
|
||||
cat << "EOF"
|
||||
|
||||
|
||||
██
|
||||
█ ██
|
||||
██ ██████ █████ ██ █████ █████ ████ ██ █████ ██
|
||||
██ ██ ██ ███ ███████ ██ ██ ██ ██ ██ ████████ ██ ██ ███████
|
||||
█████ ██████ ██ ██ ██████ ██ ████████ ██ █ ███████ ██ ██
|
||||
██ ██████ ███████ ██████ ██ ██████ ██████ ██████ ███████
|
||||
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
# Clear screen and show logo
|
||||
clear
|
||||
print_logo
|
||||
|
||||
COREDESKTOP="$HOME/.local/share/coredesktop"
|
||||
|
||||
echo "Updating CoreDesktop..."
|
||||
git -C "$COREDESKTOP" pull
|
||||
mkdir -p "$COREDESKTOP/updates.d"
|
||||
sudo cp "$COREDESKTOP/update" ~/.local/bin/update
|
||||
sudo cp "$COREDESKTOP/refresh" ~/.local/bin/refresh
|
||||
|
||||
if [[ -z "$UPDATE_REEXECED" ]]; then
|
||||
export UPDATE_REEXECED=1
|
||||
exec ~/.local/bin/update
|
||||
fi
|
||||
|
||||
for plugin in "$COREDESKTOP/updates.d/"*.sh; do
|
||||
if [ -f "$plugin" ]; then
|
||||
unset -f is_installed run_update
|
||||
source "$plugin"
|
||||
if declare -f run_update > /dev/null; then
|
||||
if ! declare -f is_installed > /dev/null || is_installed; then
|
||||
run_update
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Done."
|
||||
Reference in New Issue
Block a user