1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-06-25 16:57:12 -07:00

allow verbosity to be specified on command-line

This commit is contained in:
Connor Olding 2021-07-31 14:06:22 -07:00
parent 1e216752b6
commit 9227ade5e8

View File

@ -2,7 +2,7 @@
# this script is compatible with following shells:
# dash, bash, zsh
VERBOSE=1
VERBOSE="${VERBOSE:-1}"
NAME="$0"
[ -n "$ZSH_VERSION" -o -n "$BASH" ] || VERBOSE=0 # no colors for you
@ -81,11 +81,11 @@ softlink_pseudo() {
if [ -d "$d2" ]; then
if [ "$d1" != ".vim/bundle" ]; then # buggy on Windows
[ "${VERBOSE:-0}" -lt 1 ] || warn $'\e[34m / \e[0m' "$d1 $d2"
[ "$VERBOSE" -lt 1 ] || warn $'\e[34m / \e[0m' "$d1 $d2"
softlink_pseudo "$d1" "$d2" || exit $?
fi
elif [ -f "$d2" ]; then
[ "${VERBOSE:-0}" -lt 1 ] || warn $'\e[34m * \e[0m' "$d1"
[ "$VERBOSE" -lt 1 ] || warn $'\e[34m * \e[0m' "$d1"
hardlink "$d1" "$d2" || exit $?
else
die "i don't know how to pseudo-symlink $d2"
@ -106,7 +106,7 @@ find_new_files() {
if [ -d "$d2" ]; then
find_new_files "$d1" "$d2"
elif [ ! "$d1" -ef "$d2" ]; then
if [ "${VERBOSE:-0}" -lt 1 ]; then
if [ "$VERBOSE" -lt 1 ]; then
warn " + $d1"
else
#warn "new destination file. consider manually moving it:"