From dcd042262f8f80368a36d554e8730f90da7c8a27 Mon Sep 17 00:00:00 2001 From: Ismo Vuorinen Date: Thu, 13 Apr 2023 22:21:49 +0300 Subject: [PATCH] dotbot: removed gh-extension, use old script --- .gitmodules | 5 ---- add-submodules.sh | 1 - dotbot-gh-extension | 1 - install.conf.yaml | 21 --------------- local/bin/dfm | 6 +++++ scripts/install-gh-extensions.sh | 44 ++++++++++++++++++++++++++++++++ 6 files changed, 50 insertions(+), 28 deletions(-) delete mode 160000 dotbot-gh-extension create mode 100755 scripts/install-gh-extensions.sh diff --git a/.gitmodules b/.gitmodules index 55c6e2e..7ab9dc0 100644 --- a/.gitmodules +++ b/.gitmodules @@ -8,11 +8,6 @@ url = https://github.com/wren/dotbot-brew.git ignore = dirty -[submodule "dotbot-gh-extension"] - path = dotbot-gh-extension - url = https://github.com/fundor333/dotbot-gh-extension.git - ignore = dirty - [submodule "dotbot-include"] path = dotbot-include url = https://gitlab.com/gnfzdz/dotbot-include.git diff --git a/add-submodules.sh b/add-submodules.sh index 82aa974..9c4478c 100644 --- a/add-submodules.sh +++ b/add-submodules.sh @@ -1,5 +1,4 @@ #!/usr/bin/env bash git submodule add --name dotbot-brew -f https://github.com/wren/dotbot-brew.git dotbot-brew -git submodule add --name dotbot-gh-extension -f https://github.com/fundor333/dotbot-gh-extension.git dotbot-gh-extension git submodule add --name dotbot-include -f https://gitlab.com/gnfzdz/dotbot-include.git dotbot-include diff --git a/dotbot-gh-extension b/dotbot-gh-extension deleted file mode 160000 index 037994e..0000000 --- a/dotbot-gh-extension +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 037994ef283713bcce66261b6fd145fbb9a2eec0 diff --git a/install.conf.yaml b/install.conf.yaml index 0c7caab..f7ea532 100644 --- a/install.conf.yaml +++ b/install.conf.yaml @@ -36,24 +36,3 @@ - shell: - git submodule update --init --recursive --force - bash local/bin/dfm install all -# GitHub CLI Extensions -- ghe: - # GitHub CLI extension for generating a report on repository dependencies. - - andyfeller/gh-dependency-report - # GitHub CLI extension to generate montage from GitHub user avatars - - andyfeller/gh-montage - # An opinionated GitHub Cli extension for creating - # changelogs that adhere to the keep a changelog specification. - - chelnak/gh-changelog - # Safely deletes local branches with no upstream and no un-pushed commits - - davidraviv/gh-clean-branches - # A beautiful CLI dashboard for GitHub 🚀 - - dlvhdr/gh-dash - # A github-cli extension script to clone all repositories - # in an organization, optionally filtering by topic. - - matt-bartel/gh-clone-org - # being an extension to view the overall health of - # an organization's use of actions - - rsese/gh-actions-status - -# diff --git a/local/bin/dfm b/local/bin/dfm index 89e2356..b2d3a85 100755 --- a/local/bin/dfm +++ b/local/bin/dfm @@ -30,6 +30,7 @@ function section_install $0 brew install $0 install composer $0 install dotenv-linter + $0 install gh $0 install imagick $0 install nvm $0 install npm @@ -50,6 +51,10 @@ function section_install | sh -s -- -b "$XDG_BIN_HOME" \ && msg_done "🎉 dotenv-linter installed!" ;; + gh) + bash "$DOTFILES/scripts/install-gh-extensions.sh" \ + && msg_done "🎉 github cli extensions installed!" + ;; imagick) wget https://imagemagick.org/archive/binaries/magick > "$XDG_BIN_HOME/magick" \ && msg_done "🎉 imagick installed!" @@ -86,6 +91,7 @@ function section_install menu_item "antigen" "Updates the antigen.zsh file" menu_item "composer" "Install composer" menu_item "dotenv-linter" "Install dotenv-linter" + menu_item "gh" "Install GitHub CLI Extensions" menu_item "imagick" "Install ImageMagick CLI" menu_item "starship" "Install starship.rs" menu_item "macos" "Setup nice macOS defaults" diff --git a/scripts/install-gh-extensions.sh b/scripts/install-gh-extensions.sh new file mode 100755 index 0000000..9f141b8 --- /dev/null +++ b/scripts/install-gh-extensions.sh @@ -0,0 +1,44 @@ +#!/usr/bin/env bash +# Install GitHub CLI extensions +# +# shellcheck source="shared.sh" +source "$HOME/.dotfiles/scripts/shared.sh" + +if ! command -v gh &> /dev/null; then + msg_run "gh (GitHub Client) could not be found, please install it first" +else + extensions=( + # GitHub CLI extension for generating a report on repository dependencies. + andyfeller/gh-dependency-report + # GitHub CLI extension to generate montage from GitHub user avatars + andyfeller/gh-montage + # An opinionated GitHub Cli extension for creating + # changelogs that adhere to the keep a changelog specification. + chelnak/gh-changelog + # Safely deletes local branches with no upstream and no un-pushed commits + davidraviv/gh-clean-branches + # A beautiful CLI dashboard for GitHub 🚀 + dlvhdr/gh-dash + # A github-cli extension script to clone all repositories + # in an organization, optionally filtering by topic. + matt-bartel/gh-clone-org + # being an extension to view the overall health of + # an organization's use of actions + rsese/gh-actions-status + ) + + msg "Starting to install GitHub CLI extensions..." + + for ext in "${extensions[@]}"; do + # Trim spaces + ext=${ext// /} + # Skip comments + if [[ ${ext:0:1} == "#" ]]; then continue; fi + + msg_run "Installing $ext" + gh extensions install "$ext" + echo "" + done + + msg_ok "Done" +fi