init commit, add base for run scripts

This commit is contained in:
david pickle 2025-01-11 14:55:08 -06:00
commit e44c29ccb9
2 changed files with 46 additions and 0 deletions

43
run Executable file
View File

@ -0,0 +1,43 @@
#!/bin/zsh
single_script_filter=""
dry="0"
execute() {
log "execute $@"
if [[ $dry != "1" ]]; then
"$@"
fi
}
log() {
if [[ $dry != "1" ]]; then
echo "$@"
else
echo "[DRY RUN]: $@"
fi
}
while [[ $# > 0 ]]; do
if [[ $1 == "--dry" ]]; then
dry="1"
else
single_script_filter="$1"
fi
shift
done
script_dir=$(cd $(dirname "${ZSH_SOURCE[0]}") &> /dev/null && pwd)
log "run // script_dir: $script_dir -- args: $single_script_filter"
cd $script_dir
scripts=$(find ./runs -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

3
runs/neovim Executable file
View File

@ -0,0 +1,3 @@
#!/bin/zsh
echo "setup script for neovim"