dotfiles/home/dot-local/bin/update-code

27 lines
856 B
Text
Raw Permalink Normal View History

2022-02-03 18:33:04 +00:00
#!/usr/bin/env bash
: "${LIB_SHELL_PATH:="${XDG_LIB_HOME:-"${HOME}/.local/lib"}/bash"}"
LIB_SHELL_PATH="/home/louis/Documents/dotfiles/home/dot-local/lib/bash"
# shellcheck disable=SC2015
[[ -e "${LIB_SHELL_PATH}/common.sh" ]] && {
export IMPORTPATH="${PWD}:${LIB_SHELL_PATH}"
# shellcheck source=home/dot-local/lib/bash/common.sh
source "${LIB_SHELL_PATH}/common.sh" >/dev/null 2>&1
} || { echo "error: cannot load common shell lib" >&2; exit 1; }
import "github-api.sh"
function @report() {
printf "➜ %s of vscodium is avaiable\n" "${@}"
}
while read -r version link; do
if ! rpm -qa | grep "codium-${version}" >/dev/null; then
@report "version ${version}"
sudo dnf install -y "${link}"
else
@report "no new version"
fi
done < <(SUFFIX="$(uname -i).rpm" github_latest_release_assets 'vscodium')