box-setup/install_programs

32 lines
718 B
Bash
Executable File

#!/bin/zsh
local single_script_filter=""
local dry="0"
execute() {
log "execute $@"
[[ $dry != "1" ]] && "$@"
}
log() {
[[ $dry != "1" ]] && echo "$@" || echo "[DRY RUN]: $@"
}
while [[ $# > 0 ]]; do
[[ $1 == "--dry" ]] && dry="1" || single_script_filter="$1"
shift
done
log "install_programs // single_script_filter: $single_script_filter"
local scripts=$(find ./installs_and_builds -maxdepth 1 -mindepth 1 -type f | sort)
for script in ${=scripts}; do
if [[ -x $script ]]; then
if echo "$script" | grep -qv "$single_script_filter"; then
log "filter is $single_script_filter // ignoring: $script"
continue
fi
execute ./$script
fi
done