Clean up copy_configs, refactor some install sripts

This commit is contained in:
2025-01-31 00:46:43 -06:00
parent 4c0cabc448
commit 948db247d7
7 changed files with 27 additions and 35 deletions

View File

@ -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