chore: general changes

This commit is contained in:
2024-08-30 14:27:02 +02:00
parent 93809054f6
commit 8f207382e9
7 changed files with 35 additions and 21 deletions

View File

@ -12,8 +12,6 @@ logo() {
println " " "cyan"
tput sgr0
continue_eitherway=$1
# Print if repo is dirty and the count of untracked files, modified files and staged files
if [[ $(git -C ~/dotfiles status --porcelain) ]]; then
printfe "%s" "yellow" "dotfiles repo is dirty "
@ -27,22 +25,6 @@ logo() {
printfe "%s" "yellow" "[!] You have $(git -C ~/dotfiles log origin/master..HEAD --oneline | wc -l | tr -d ' ') commit(s) to push"
fi
println "" "normal"
if [[ $continue_eitherway == "continue" ]]; then
return
fi
if [[ $(git -C ~/dotfiles status --porcelain) ]]; then
# Continue?
printfe "%s" "red" "Continue anyway? [y/N] "
read -k 1
if [[ $REPLY != "y" ]]; then
println "" "normal"
exit 0
fi
println "" "normal"
println "" "normal"
fi
}
# print colored with printf (args: format, color, message ...)

View File

@ -3,8 +3,15 @@
source $HOME/dotfiles/bin/helpers/functions.sh
ensure_gnome_extensions_installed() {
if ! command -v gnome-extensions &> /dev/null; then
printfe "%s\n" "red" " - gnome-extensions command not found, likely not running GNOME."
# In case gnome-extensions is installed but we don't use GNOME let's do a check
if [ "$XDG_CURRENT_DESKTOP" != "GNOME" ]; then
printfe "%s\n" "red" " - XDG_CURRENT_DESKTOP is not GNOME, likely not running GNOME."
return
fi
# Attempt to connect to GNOME shell, if it fails, we can stop here
if ! gnome-extensions &> /dev/null; then
printfe "%s\n" "red" " - gnome-extensions command not found, likely not running GNOME?!"
return
fi