From a277b12884f0922e9fe0a04e22452c0a6d3e4727 Mon Sep 17 00:00:00 2001 From: david Date: Fri, 4 Apr 2025 16:55:39 -0500 Subject: [PATCH] Update readme, use a sort order for install scripts --- README.md | 16 +++++++++++----- install_programs | 4 ++-- installs_and_builds/{libs => s01_libs} | 0 installs_and_builds/{utils => s02_utils} | 0 installs_and_builds/{git => s11_git} | 0 installs_and_builds/{neovim => s12_neovim} | 0 installs_and_builds/{tmux => s13_tmux} | 0 installs_and_builds/{fzf => s14_fzf} | 0 ...neovim_from_source => s99_neovim_from_source} | 0 make_desired_dirs | 8 ++++++-- set_env_vars | 5 ++++- 11 files changed, 23 insertions(+), 10 deletions(-) rename installs_and_builds/{libs => s01_libs} (100%) rename installs_and_builds/{utils => s02_utils} (100%) rename installs_and_builds/{git => s11_git} (100%) rename installs_and_builds/{neovim => s12_neovim} (100%) rename installs_and_builds/{tmux => s13_tmux} (100%) rename installs_and_builds/{fzf => s14_fzf} (100%) rename installs_and_builds/{neovim_from_source => s99_neovim_from_source} (100%) diff --git a/README.md b/README.md index 2b52175..c4628cf 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,12 @@ -### script run plan -- run `./pre_install_*` scripts -- run `./install_programs` to install/build/etc programs -- run `./copy_configs` to copy configs/scripts/executables into place -- run `./post_config_*` scripts +# repo containing configs and scripts to set up a box + +### prerequisites +- install git if not already installed +- clone this repo +- if on macOS, install [homebrew](https://brew.sh/) +- export the env var `BOX_SETUP_OS` to indicate the operating system + - (options defined in `set_env_vars` file) + +### script run +- from the repo's root directory, run `./setup_this_box` diff --git a/install_programs b/install_programs index bcfa8c0..13c6029 100755 --- a/install_programs +++ b/install_programs @@ -18,8 +18,8 @@ while [[ $# > 0 ]]; do done log "install_programs // single_script_filter: $single_script_filter" -local scripts=(`find ./installs_and_builds -maxdepth 1 -mindepth 1 -type f`) -for script in $scripts; do +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" diff --git a/installs_and_builds/libs b/installs_and_builds/s01_libs similarity index 100% rename from installs_and_builds/libs rename to installs_and_builds/s01_libs diff --git a/installs_and_builds/utils b/installs_and_builds/s02_utils similarity index 100% rename from installs_and_builds/utils rename to installs_and_builds/s02_utils diff --git a/installs_and_builds/git b/installs_and_builds/s11_git similarity index 100% rename from installs_and_builds/git rename to installs_and_builds/s11_git diff --git a/installs_and_builds/neovim b/installs_and_builds/s12_neovim similarity index 100% rename from installs_and_builds/neovim rename to installs_and_builds/s12_neovim diff --git a/installs_and_builds/tmux b/installs_and_builds/s13_tmux similarity index 100% rename from installs_and_builds/tmux rename to installs_and_builds/s13_tmux diff --git a/installs_and_builds/fzf b/installs_and_builds/s14_fzf similarity index 100% rename from installs_and_builds/fzf rename to installs_and_builds/s14_fzf diff --git a/installs_and_builds/neovim_from_source b/installs_and_builds/s99_neovim_from_source similarity index 100% rename from installs_and_builds/neovim_from_source rename to installs_and_builds/s99_neovim_from_source diff --git a/make_desired_dirs b/make_desired_dirs index 7033756..2e9106c 100755 --- a/make_desired_dirs +++ b/make_desired_dirs @@ -1,4 +1,8 @@ #!/bin/zsh -[[ ! -d $HOMEBOX ]] && mkdir $HOMEBOX -[[ ! -d $DEVDIR ]] && mkdir $DEVDIR +[[ ! -d "$HOMEBOX" ]] && mkdir $HOMEBOX + +[[ ! -d "$DEVDIR" ]] && mkdir $DEVDIR +[[ ! -d "$DEVDIR/git" ]] && mkdir $DEVDIR/git +[[ ! -d "$DEVDIR/git/me" ]] && mkdir $DEVDIR/git/me +[[ ! -d "$DEVDIR/git/other" ]] && mkdir $DEVDIR/git/other diff --git a/set_env_vars b/set_env_vars index c4eddd2..29b7106 100644 --- a/set_env_vars +++ b/set_env_vars @@ -1,4 +1,6 @@ -[[ -z $BOX_SETUP_OS ]] && echo "BOX_SETUP_OS must be set" && exit 1 +[[ -z $BOX_SETUP_OS ]] && + echo "BOX_SETUP_OS must be set; options: arch, artix, debian, macos" && + exit 1 local install_cmd='' case $BOX_SETUP_OS in @@ -6,4 +8,5 @@ case $BOX_SETUP_OS in (debian) export install_cmd="sudo apt install" ;; (macos) export install_cmd="brew install" ;; esac + export BOX_SETUP_INSTALL_COMMAND="$install_cmd"