From 2d12e3f09a9d33bf313ffbd185589c83fbeeea2e Mon Sep 17 00:00:00 2001 From: Michael Housh Date: Wed, 15 Feb 2023 08:30:09 -0500 Subject: [PATCH] Fixed zshrc-local operation --- Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e18fa55..8ad402d 100644 --- a/Makefile +++ b/Makefile @@ -50,6 +50,12 @@ bootstrap: bootstrap-homebrew bootstrap-brews bootstrap-casks stow bootstrap-non # the normal .zshrc for configuration that is only # relevant on the local machine. zshrc-local: - touch "$(PWD)/zsh/config/.zshrc-local" + # check if a file already exists or not and create it if not. + test -f "$(PWD)/zsh/config/.zshrc-local" \ + || echo "#!/usr/bin/env zsh" > "$(PWD)/zsh/config/.zshrc-local" + # add symlink to appropriate location if doesn't exist. + test -L "$(HOME)/.config/zsh/.zshrc-local" \ + || ln -sfv "$(PWD)/zsh/config/.zshrc-local" "$(HOME)/.config/zsh/" + # open the file to edit. vim "$(PWD)/zsh/config/.zshrc-local"