Add update checker script
This commit is contained in:
parent
4cd30d3ccf
commit
a46a9fed79
4 changed files with 26 additions and 2 deletions
17
bin/updatechecker
Executable file
17
bin/updatechecker
Executable file
|
@ -0,0 +1,17 @@
|
||||||
|
#!/bin/bash
|
||||||
|
cd "$HOME/.dotfiles"
|
||||||
|
export "COLOR=31"
|
||||||
|
export "COLOR_REGULAR=\e[0;${COLOR}m"
|
||||||
|
export "COLOR_BOLD=\e[1;${COLOR}m"
|
||||||
|
export "COLOR_RESET=\e[0m"
|
||||||
|
export "LATEST_COMMIT=$(curl -sX 'GET' 'https://git.staropensource.de/api/v1/repos/JeremyStarTM/punktdateien/branches/develop' -H 'accept: application/json'|jq --monochrome-output '.commit.id')"
|
||||||
|
export "LATEST_COMMIT_MESSAGE=$(curl -sX 'GET' 'https://git.staropensource.de/api/v1/repos/JeremyStarTM/punktdateien/branches/develop' -H 'accept: application/json'|jq --monochrome-output '.commit.message'|sed 's/\\n//g')"
|
||||||
|
|
||||||
|
if [ ! "$(env PAGER= git log -n 1 --pretty=format:\"%H\")" == "$LATEST_COMMIT" ]; then
|
||||||
|
echo -e "${COLOR_BOLD}An update for jstm's punkdateien is available."
|
||||||
|
echo -e "${COLOR_REGULAR}Latest commit: ${LATEST_COMMIT}"
|
||||||
|
echo -e "${COLOR_REGULAR} -> Message: ${LATEST_COMMIT_MESSAGE}"
|
||||||
|
echo -en "${COLOR_RESET}"
|
||||||
|
elif [ ! "${BASHRC}" == "true" ]; then
|
||||||
|
echo -e "${COLOR_BOLD}No update available"
|
||||||
|
fi
|
|
@ -76,6 +76,9 @@ link "lone-files/konsolerc" ".config/konsolerc"
|
||||||
link "konsole" ".local/share/konsole"
|
link "konsole" ".local/share/konsole"
|
||||||
link "lone-files/dolphinrc" ".config/dolphinrc"
|
link "lone-files/dolphinrc" ".config/dolphinrc"
|
||||||
|
|
||||||
|
# punktdateien scripts
|
||||||
|
link "bin/updatechecker" ".local/bin/dotfiles-updatechecker"
|
||||||
|
|
||||||
# write install file
|
# write install file
|
||||||
echo "pls don't remove" > "$HOME/.config/.jstm_dotfiles"
|
echo "pls don't remove" > "$HOME/.config/.jstm_dotfiles"
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
export SDKMAN_DIR="$HOME/.sdkman"
|
||||||
|
[[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh"
|
||||||
source "/usr/share/icons-in-terminal/icons_bash.sh"
|
source "/usr/share/icons-in-terminal/icons_bash.sh"
|
||||||
source "${HOME}/.jstmbash/init.source"
|
source "${HOME}/.jstmbash/init.source"
|
||||||
eval "$(starship init bash)"
|
eval "$(starship init bash)"
|
||||||
|
@ -10,5 +12,4 @@ function cleanhome() {
|
||||||
}
|
}
|
||||||
alias "quote=fortune -s linux debian|cowsay"
|
alias "quote=fortune -s linux debian|cowsay"
|
||||||
quote
|
quote
|
||||||
export SDKMAN_DIR="$HOME/.sdkman"
|
env "BASHRC=true" dotfiles-updatechecker
|
||||||
[[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh"
|
|
||||||
|
|
|
@ -55,3 +55,6 @@ unlink ".config/fontconfig"
|
||||||
unlink ".config/konsolerc"
|
unlink ".config/konsolerc"
|
||||||
unlink ".local/share/konsole"
|
unlink ".local/share/konsole"
|
||||||
unlink ".config/dolphinrc"
|
unlink ".config/dolphinrc"
|
||||||
|
|
||||||
|
# punktdateien scripts
|
||||||
|
unlink ".local/bin/dotfiles-updatechecker"
|
||||||
|
|
Loading…
Reference in a new issue