2023-11-12 05:31:20 +09:00
|
|
|
color() {
|
|
|
|
if [ -t 1 ]; then
|
|
|
|
tput setaf "${1:-7}"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
say() {
|
|
|
|
color 5 # magenta
|
2023-11-14 23:04:56 +09:00
|
|
|
printf "( ^-^) < %s\n" "$1"
|
2023-11-12 05:31:20 +09:00
|
|
|
color
|
|
|
|
}
|
|
|
|
|
|
|
|
running() {
|
|
|
|
color 3 # yellow
|
2023-11-14 23:04:56 +09:00
|
|
|
printf "[running] \$ %s\n" "$1"
|
2023-11-12 05:31:20 +09:00
|
|
|
color
|
|
|
|
}
|
2023-11-14 23:04:56 +09:00
|
|
|
|
|
|
|
br() {
|
|
|
|
printf "\\n"
|
|
|
|
}
|
2023-11-14 23:54:37 +09:00
|
|
|
|
|
|
|
version() {
|
|
|
|
COMMIT_DATE=$(git show --no-patch --pretty="%cs" FETCH_HEAD | sed -e "s/-//g" | cut -c 3-)
|
|
|
|
COMMIT_HASH_INITIAL=$(printf "%s" "$(git rev-parse FETCH_HEAD)" | cut -c 1)
|
2023-11-15 13:50:54 +09:00
|
|
|
printf "%s.%s" "${COMMIT_DATE}" "${COMMIT_HASH_INITIAL}"
|
2023-11-14 23:54:37 +09:00
|
|
|
}
|