Unify scripts by using a common color / function framework
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
a9570cde04
commit
eeb4ba2d79
5 changed files with 24 additions and 34 deletions
|
@ -3,12 +3,7 @@
|
|||
set -o pipefail
|
||||
set -e
|
||||
|
||||
STEP_COLOR="\033[0;36m"
|
||||
NO_COLOR="\033[0m"
|
||||
|
||||
function step {
|
||||
echo -e ${STEP_COLOR}[$(date +%H:%M:%S)] $1${NO_COLOR}
|
||||
}
|
||||
source "${HOME}/bin/script_framework.sh"
|
||||
|
||||
### Fix committer email by repo
|
||||
|
||||
|
|
|
@ -3,12 +3,7 @@
|
|||
set -o pipefail
|
||||
set -e
|
||||
|
||||
STEP_COLOR="\033[0;36m"
|
||||
NO_COLOR="\033[0m"
|
||||
|
||||
function step {
|
||||
echo -e ${STEP_COLOR}[$(date +%H:%M:%S)] $1${NO_COLOR}
|
||||
}
|
||||
source "${HOME}/bin/script_framework.sh"
|
||||
|
||||
### Determine what to push
|
||||
|
||||
|
|
|
@ -3,12 +3,7 @@
|
|||
set -o pipefail
|
||||
set -e
|
||||
|
||||
STEP_COLOR="\033[0;36m"
|
||||
NO_COLOR="\033[0m"
|
||||
|
||||
function step {
|
||||
echo -e ${STEP_COLOR}[$(date +%H:%M:%S)] $1${NO_COLOR}
|
||||
}
|
||||
source "${HOME}/bin/script_framework.sh"
|
||||
|
||||
step "Loading required keys to pull"
|
||||
git loadkey
|
||||
|
|
20
bin/script_framework.sh
Normal file
20
bin/script_framework.sh
Normal file
|
@ -0,0 +1,20 @@
|
|||
COLOR_RED="\033[0;31m"
|
||||
COLOR_GREEN="\033[0;32m"
|
||||
COLOR_CYAN="\033[0;36m"
|
||||
COLOR_PLAIN="\033[0m"
|
||||
|
||||
function error {
|
||||
echo -e "${COLOR_RED}$@${COLOR_PLAIN}"
|
||||
}
|
||||
|
||||
function success {
|
||||
echo -e "${COLOR_GREEN}$@${COLOR_PLAIN}"
|
||||
}
|
||||
|
||||
function info {
|
||||
echo -e "${COLOR_CYAN}$@${COLOR_PLAIN}"
|
||||
}
|
||||
|
||||
function step {
|
||||
info "[$(date +%H:%M:%S)] $@"
|
||||
}
|
|
@ -3,22 +3,7 @@
|
|||
set -e
|
||||
set -o pipefail
|
||||
|
||||
COLOR_RED="\033[0;31m"
|
||||
COLOR_GREEN="\033[0;32m"
|
||||
COLOR_CYAN="\033[0;36m"
|
||||
COLOR_PLAIN="\033[0m"
|
||||
|
||||
function error {
|
||||
echo -e "${COLOR_RED}$@${COLOR_PLAIN}"
|
||||
}
|
||||
|
||||
function success {
|
||||
echo -e "${COLOR_GREEN}$@${COLOR_PLAIN}"
|
||||
}
|
||||
|
||||
function info {
|
||||
echo -e "${COLOR_CYAN}$@${COLOR_PLAIN}"
|
||||
}
|
||||
source "${HOME}/bin/script_framework.sh"
|
||||
|
||||
if ! ( which vault > /dev/null ); then
|
||||
error "vault is required."
|
||||
|
|
Loading…
Reference in a new issue