diff --git a/scripts/.local/scripts/clean_screenshots b/scripts/.local/scripts/clean_screenshots index 67299d2..29bb217 100755 --- a/scripts/.local/scripts/clean_screenshots +++ b/scripts/.local/scripts/clean_screenshots @@ -1,6 +1,5 @@ #!/bin/sh for file in "$SCREENSHOTS"/*; do - echo "Removing file: $file" >&2 rm "$file" done diff --git a/scripts/.local/scripts/newx b/scripts/.local/scripts/newx index 5a55416..c536b2b 100755 --- a/scripts/.local/scripts/newx +++ b/scripts/.local/scripts/newx @@ -6,9 +6,13 @@ test ! -n "${SCRIPTS}" && echo "SCRIPTS not set" && exit 1; # fallback to check if the name arg ${1} exists, if not show usage text. -test ! -n "${1}" && echo "usage: newscript " && exit 1; +test ! -n "${1}" && \ + echo "usage: newscript " && \ + echo "shell defaults to `sh` if not supplied" && \ + exit 1; path="${SCRIPTS}/${1}" +shell="${2:-sh}" if [ -e "${path}" ]; then read -p "${1} already exists. Edit? " yes @@ -18,7 +22,7 @@ if [ -e "${path}" ]; then exit 0 fi -printf "#!/bin/sh\n\n" > "${path}" +printf "#!/bin/${shell}"\n\n" > "${path}" chmod +x "${path}" exec vim +2 "${path}" diff --git a/scripts/install_launch_agents b/scripts/install_launch_agents index f5bb61b..866a7cc 100755 --- a/scripts/install_launch_agents +++ b/scripts/install_launch_agents @@ -10,8 +10,10 @@ uid="$(id -u "$(whoami)")" mkdir -p "$agent_dir" for file in "${DOTFILES}"/macOS/LaunchAgents/*.plist; do - filename=$(basename "${file}") + # get just the base file name, similar to using `basename` but w/o a subshell + filename="${file##*/}" path="${agent_dir}/${filename}" + echo "$filename" if ! test -e "${path}"; then echo "Installing Agent: ${filename}" cp "${file}" "${path}"