From 2adcfc1787030ecaa9917565d43f0c2c4ab4108d Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Sat, 21 Jan 2017 17:31:18 -0500 Subject: Use zsh for shell scripts --- import.sh | 6 +++--- install.sh | 50 +++++++++++++++++++++++++------------------------- prune.sh | 6 +++--- vendor.sh | 2 +- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/import.sh b/import.sh index 66dde777..bd4909fb 100755 --- a/import.sh +++ b/import.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env zsh # Import a file from ~ and replace it with a symlink. @@ -9,7 +9,7 @@ error() { exit 1 } -[ -z "$1" ] && error "no path" +[ -z "$1" ] && error 'no path' source_path="$HOME/$1" dest_path="$PWD/$1" @@ -20,4 +20,4 @@ dest_path="$PWD/$1" mkdir -p "$(dirname "$dest_path")" mv "$source_path" "$dest_path" ln -s "$dest_path" "$source_path" -echo "link $1" >> install.sh +echo "link '$1'" >> install.sh diff --git a/install.sh b/install.sh index 7a939866..63790ef0 100755 --- a/install.sh +++ b/install.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env zsh # Create symlinks in ~ for files in the current directory. @@ -16,33 +16,33 @@ link() { [ -h "$dest_path" ] && return [ -e "$dest_path" ] && error "$dest_path exists" - mkdir -p "$(dirname $dest_path)" + mkdir -p "$(dirname "$dest_path")" ln -s "$source_path" "$dest_path" echo "$1" } -if [ -d ~/Library ]; then - link Library/Application\ Support/Karabiner/private.xml - link Library/Keyboard\ Layouts/Programmer.keylayout +if [ -d '~/Library' ]; then + link 'Library/Application Support/Karabiner/private.xml' + link 'Library/Keyboard Layouts/Programmer.keylayout' fi -link .bin/clock.c -link .bin/jrp.c -link .bin/manpager -link .bin/pbcopy.c -link .bin/pbd.c -link .bin/xx.c -link .config/git/config -link .config/git/ignore -link .config/htop/htoprc -link .config/nvim/autoload/pathogen.vim -link .config/nvim/colors/lame.vim -link .config/nvim/init.vim -link .config/nvim/syntax/nasm.vim -link .gdbinit -link .gnupg/gpg-agent.conf -link .inputrc -link .psqlrc -link .ssh/config -link .tmux.conf -link .zshrc +link '.bin/clock.c' +link '.bin/jrp.c' +link '.bin/manpager' +link '.bin/pbcopy.c' +link '.bin/pbd.c' +link '.bin/xx.c' +link '.config/git/config' +link '.config/git/ignore' +link '.config/htop/htoprc' +link '.config/nvim/autoload/pathogen.vim' +link '.config/nvim/colors/lame.vim' +link '.config/nvim/init.vim' +link '.config/nvim/syntax/nasm.vim' +link '.gdbinit' +link '.gnupg/gpg-agent.conf' +link '.inputrc' +link '.psqlrc' +link '.ssh/config' +link '.tmux.conf' +link '.zshrc' diff --git a/prune.sh b/prune.sh index af2379e5..cc6e2444 100755 --- a/prune.sh +++ b/prune.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env zsh # Remove symbolic links in ~ to files that no longer exist. @@ -7,6 +7,6 @@ set -o errexit -o nounset -o pipefail paths=$(find -L ~ -type l -lname "$PWD/*") for path in $paths; do - rm $path - echo $path + rm "$path" + echo "$path" done diff --git a/vendor.sh b/vendor.sh index 710231a2..b5785d06 100755 --- a/vendor.sh +++ b/vendor.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env zsh # Pull latest versions of vendored files. -- cgit 1.4.1