-
Notifications
You must be signed in to change notification settings - Fork 0
/
starter
executable file
·32 lines (29 loc) · 1.13 KB
/
starter
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env bash
set -e
set -o pipefail
print_usage() {
echo "$(tput bold)USAGE$(tput sgr 0)"
echo " helm starter <action> [options]"
echo ""
echo "$(tput bold)COMMANDS$(tput sgr 0)"
echo " add Add one or more starter scaffolds to the local collection"
echo " list List all available starter scaffolds in the local collection"
echo " remove Remove one or more starter scaffolds from the local collection"
echo " update Update one or more starter scaffolds in the local collection"
echo ""
echo "$(tput bold)OPTIONS$(tput sgr 0)"
echo " $(tput setaf 4)--help, -h $(tput setaf 3)Flag$(tput sgr 0)"
echo " Displays this help message."
echo ""
}
## Create the 'starters' directory if it doesn't exist
mkdir -p "${HELM_DATA_HOME}/starters"
## Execute the specified command, passing any input to it
if [ -f "${HELM_PLUGIN_DIR}/bin/${1}" ]; then
"${HELM_PLUGIN_DIR}/bin/${1}" "${@:2}"
elif [[ "${1}" =~ ^-?-h(elp)?$ ]]; then
print_usage && exit 0
else
echo "$(tput setaf 1)ERROR: Invalid input: ${1}$(tput sgr 0)"
print_usage && exit 1
fi