commit e44c29ccb9efb6c77d2bf48026c365cac772dbf8 Author: david Date: Sat Jan 11 14:55:08 2025 -0600 init commit, add base for run scripts diff --git a/run b/run new file mode 100755 index 0000000..db0ee9c --- /dev/null +++ b/run @@ -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 + diff --git a/runs/neovim b/runs/neovim new file mode 100755 index 0000000..e751170 --- /dev/null +++ b/runs/neovim @@ -0,0 +1,3 @@ +#!/bin/zsh + +echo "setup script for neovim"