Last active
April 10, 2022 08:14
-
-
Save RichardBronosky/41cc3fa7c204d79afbf57bdf96b1bfea to your computer and use it in GitHub Desktop.
Helm plugin to list repos in a copy-paste friendly format for sharing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env bash | |
set -eu | |
_usage(){ | |
cat<<EOF | |
Usage: | |
./dependabot-merge.sh get_branches | ./dependabot-merge.sh checkout_merge_push_delete | |
EOF | |
_funcs | sed $'1i Functions:\n; s/^/ /' | |
} | |
_funcs(){ | |
declare -F | awk '$2=="-f" && $3~/^[^_]/{print $3}' | |
} | |
function repos(){ | |
helm repo list | sed '1d; s/^/helm repo add /' | |
} | |
_main(){ | |
if [[ -n "$@" ]]; then | |
cmd="$1"; shift | |
$cmd "$@" | |
else | |
_usage | |
fi | |
} | |
_main "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SEE: https://www.datree.io/resources/how-to-build-a-helm-plugin-in-minutes | |
# https://helm.sh/docs/topics/plugins/#environment-variables | |
name: "repos" | |
usage: "helm repos" | |
description: "List repos in a copy-paste friendly format for sharing" | |
command: "$HELM_PLUGIN_DIR/plugin.bash repos" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment