feat!: refactor base, config, dfm and scripts

This commit is contained in:
2024-07-23 03:43:12 +03:00
parent adecceda7a
commit 1f2ca90ca5
36 changed files with 1543 additions and 897 deletions

View File

@@ -2,13 +2,17 @@
# Install GitHub CLI extensions
#
# shellcheck source="shared.sh"
eval "$HOME/.dotfiles/scripts/shared.sh"
source "${DOTFILES}/config/shared.sh"
# Enable verbosity with VERBOSE=1
VERBOSE="${VERBOSE:-0}"
msg_run "Installing gh (GitHub Client) extensions"
! x-have "gh" \
&& msg_err "gh (GitHub Client) could not be found, please install it first" \
&& exit 0
if ! command -v gh &> /dev/null; then
msg_err "gh (GitHub Client) could not be found, please install it first"
exit 0
fi
extensions=(
# GitHub CLI extension for generating a report on repository dependencies.
@@ -30,15 +34,25 @@ extensions=(
rsese/gh-actions-status
)
for ext in "${extensions[@]}"; do
# Trim spaces
ext=${ext// /}
# Skip comments
if [[ ${ext:0:1} == "#" ]]; then continue; fi
# Function to install GitHub CLI extensions
install_extensions()
{
for ext in "${extensions[@]}"; do
# Trim spaces
ext=${ext// /}
# Skip comments
if [[ ${ext:0:1} == "#" ]]; then continue; fi
msg_nested "Installing $ext"
gh extensions install "$ext"
echo ""
done
msg_nested "Installing $ext"
gh extension install "$ext"
echo ""
done
}
msg_ok "Done"
main()
{
install_extensions
msg_ok "Done"
}
main "$@"