Refactor a few things

This commit is contained in:
david
2025-04-04 16:55:39 -05:00
parent 33976f54a7
commit 853c9522e7
6 changed files with 16 additions and 37 deletions

16
run
View File

@@ -5,25 +5,15 @@ dry="0"
execute() {
log "execute $@"
if [[ $dry != "1" ]]; then
"$@"
fi
[[ $dry != "1" ]] && "$@"
}
log() {
if [[ $dry != "1" ]]; then
echo "$@"
else
echo "[DRY RUN]: $@"
fi
[[ $dry != "1" ]] && echo "$@" || echo "[DRY RUN]: $@"
}
while [[ $# > 0 ]]; do
if [[ $1 == "--dry" ]]; then
dry="1"
else
single_script_filter="$1"
fi
[[ $1 == "--dry" ]] && dry="1" || single_script_filter="$1"
shift
done