From 34b117fc3018e4c0a6f5c8b53548648dabc46585 Mon Sep 17 00:00:00 2001 From: david Date: Fri, 31 Jan 2025 00:46:43 -0600 Subject: [PATCH] Clean up copy_configs, refactor some install sripts --- README.md | 2 -- copy_configs | 25 ++++++---------------- installs_and_builds/s01_libs | 2 +- installs_and_builds/s02_utils | 9 +++++++- installs_and_builds/s19_lang_general | 13 +++++------ installs_and_builds/s99_neovim_from_source | 5 ++--- make_config_dirs | 4 +--- 7 files changed, 26 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index 6ad7f26..18a1e84 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,6 @@ - i.e. source repos, mirrors, etc. are configured - if on macOS, have to first install the package manager, [homebrew](https://brew.sh/) - zsh is installed (scripts are written for zsh) - - ensure ZDOTDIR is set in a persistent way for system (not just setup scripts) - - current approach: add `export ZDOTDIR="$HOME/.config/zsh"` to `/etc/zshenv` - export the env var `BOX_SETUP_OS` to indicate the operating system - options defined in `set_script_env_vars` file - ensure sudo access is configured for the current user (2025-01-27, not needed on macos) diff --git a/copy_configs b/copy_configs index 2f9ac3e..0f1a26a 100755 --- a/copy_configs +++ b/copy_configs @@ -1,22 +1,7 @@ #!/bin/zsh -local dry="0" - -execute() { - log "execute $@" - [[ $dry != "1" ]] && "$@" -} - -log() { - [[ $dry != "1" ]] && echo "$@" || echo "[DRY RUN]: $@" -} - -while [[ $# > 0 ]]; do - [[ $1 == "--dry" ]] && dry="1" - shift -done - -log "---------------- dotfiles ----------------" +execute() { log "execute $@" && "$@" } +log() { echo "$@" } copy_dir() { local from=$1 @@ -38,10 +23,13 @@ copy_file() { execute cp -p $from $to/$filename } +log "---------------- dotfiles ----------------" + copy_dir src_files/.config $XDG_CONFIG_HOME copy_dir src_files/.local $DIR_LOCAL -#copy_file src_files/.example_file $HOME +# duplicate, but copy anyway, ensures set if zsh isn't yet looking to $XDG_CONFIG_HOME/zsh +copy_file src_files/.config/zsh/.zshenv $HOME # on macos, handle sim-linking to gimp config since gimp defaults to app-support if [[ "$BOX_SETUP_OS" = "macos" ]]; then @@ -49,6 +37,7 @@ if [[ "$BOX_SETUP_OS" = "macos" ]]; then log "deleting existing GIMP link/dir: $macos_gimp_dir" [[ -h "$macos_gimp_dir" ]] && rm $macos_gimp_dir [[ -d "$macos_gimp_dir" ]] && rm -rf $macos_gimp_dir + log "linking $macos_gimp_dir to \$XDG_CONFIG_HOME/GIMP" ln -s $XDG_CONFIG_HOME/GIMP $macos_gimp_dir fi diff --git a/installs_and_builds/s01_libs b/installs_and_builds/s01_libs index dca5281..f4256b3 100755 --- a/installs_and_builds/s01_libs +++ b/installs_and_builds/s01_libs @@ -1,3 +1,3 @@ #!/bin/zsh -${=BOX_SETUP_INSTALL_COMMAND} cmake gettext +# ${=BOX_SETUP_INSTALL_COMMAND} zxcv_placeholder diff --git a/installs_and_builds/s02_utils b/installs_and_builds/s02_utils index d014c25..3746112 100755 --- a/installs_and_builds/s02_utils +++ b/installs_and_builds/s02_utils @@ -1,7 +1,14 @@ #!/bin/zsh # likely on unix systems already: find xargs grep sed awk -${=BOX_SETUP_INSTALL_COMMAND} culr jq parallel fzf +${=BOX_SETUP_INSTALL_COMMAND} \ + curl \ + jq \ + parallel \ + fzf \ + make \ + cmake \ + gettext [[ "$BOX_SETUP_OS" = "macos" ]] && ${=BOX_SETUP_INSTALL_COMMAND} coreutils diff --git a/installs_and_builds/s19_lang_general b/installs_and_builds/s19_lang_general index 578a592..1ed628f 100755 --- a/installs_and_builds/s19_lang_general +++ b/installs_and_builds/s19_lang_general @@ -1,9 +1,10 @@ #!/bin/zsh -local lua_package="lua5.1" -[[ "$BOX_SETUP_OS" = "macos" ]] && lua_package="lua@5.1" - -${=BOX_SETUP_INSTALL_COMMAND} "$lua_package" liblua5.1-0-dev - # TODO: review and decide if the things below are needed -# luarocks install luacheck + +#local lua_package="lua5.1" +#[[ "$BOX_SETUP_OS" = "macos" ]] && lua_package="lua@5.1" + +#${=BOX_SETUP_INSTALL_COMMAND} "$lua_package" liblua5.1-0-dev + +#luarocks install luacheck diff --git a/installs_and_builds/s99_neovim_from_source b/installs_and_builds/s99_neovim_from_source index 0fad5e6..dafb176 100755 --- a/installs_and_builds/s99_neovim_from_source +++ b/installs_and_builds/s99_neovim_from_source @@ -1,5 +1,7 @@ #!/bin/zsh +# from primeagen's dev repo, uncomment/edit as needed + # local neovim_dir=$HOME/.local/build/neovim # local neovim_version="v0.10.3" # [ ! -z $NVIM_VERSION ] && neovim_version="$NVIM_VERSION" @@ -13,15 +15,12 @@ # make -C $neovim_dir CMAKE_BUILD_TYPE=RelWithDebInfo # sudo make -C $neovim_dir install -# lines below from primeagen's dev repo, uncomment/edit as needed # git clone https://github.com/ThePrimeagen/harpoon.git $HOME/personal/harpoon # cd $HOME/personal/harpoon # git fetch # git checkout harpoon2 # git clone https://github.com/ThePrimeagen/vim-apm.git $HOME/personal/vim-apm -# git clone https://github.com/ThePrimeagen/vim-with-me.git $HOME/personal/vim-with-me -# git clone https://github.com/ThePrimeagen/vim-arcade.git $HOME/personal/vim-arcade # git clone https://github.com/ThePrimeagen/caleb.git $HOME/personal/caleb # git clone https://github.com/nvim-lua/plenary.nvim.git $HOME/personal/plenary diff --git a/make_config_dirs b/make_config_dirs index 1b63694..32641bd 100755 --- a/make_config_dirs +++ b/make_config_dirs @@ -1,9 +1,7 @@ #!/bin/zsh -# source file where vars are defined -source ./src_files/.config/zsh/.zshenv +source ./src_files/.config/zsh/.zshenv # source these vars for use below -# any dirs made here should be defined in the file sourced above [[ ! -d "$DIR_LOCAL" ]] && mkdir "$DIR_LOCAL" [[ ! -d "$DIR_BIN" ]] && mkdir "$DIR_BIN" [[ ! -d "$DIR_BUILD" ]] && mkdir "$DIR_BUILD"