Refactor names
This commit is contained in:
33
install_programs
Executable file
33
install_programs
Executable file
@ -0,0 +1,33 @@
|
||||
#!/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
|
||||
|
||||
local script_dir=$(cd $(dirname "${ZSH_SOURCE[0]}") &> /dev/null && pwd)
|
||||
log "install_programs // script_dir: $script_dir -- args: $single_script_filter"
|
||||
cd $script_dir
|
||||
local scripts=(`find ./installs_and_builds -maxdepth 1 -mindepth 1 -type f`)
|
||||
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
|
||||
|
Reference in New Issue
Block a user