summary refs log tree commit diff
path: root/link.zsh
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2018-03-28 13:13:51 -0400
committerJune McEnroe <june@causal.agency>2018-03-28 13:38:22 -0400
commit2e5cdd8a31b440fc8e913579f5a5b4a369b3a293 (patch)
treec131c733501905e0bb962bf1e91a33fea983261a /link.zsh
parentSort extern crate lines with \c (diff)
downloadsrc-2e5cdd8a31b440fc8e913579f5a5b4a369b3a293.tar.gz
src-2e5cdd8a31b440fc8e913579f5a5b4a369b3a293.zip
Use [[ ]] in zsh scripts
Diffstat (limited to '')
-rwxr-xr-xlink.zsh6
1 files changed, 3 insertions, 3 deletions
diff --git a/link.zsh b/link.zsh
index 42c8d04c..f5ed565c 100755
--- a/link.zsh
+++ b/link.zsh
@@ -1,10 +1,10 @@
 #!/usr/bin/env zsh
 set -o errexit -o nounset -o pipefail
 
-if [ $# -eq 1 ]; then
+if [[ $# -eq 1 ]]; then
     linkPath="$1"
     filePath="$PWD/home/${linkPath#$HOME/}"
-    [ ! -f "$filePath" ]
+    [[ ! -f "$filePath" ]]
     mkdir -p $(dirname "$filePath")
     mv "$linkPath" "$filePath"
 fi
@@ -12,7 +12,7 @@ fi
 find home -type f | while read findPath; do
     filePath="$PWD/$findPath"
     linkPath="$HOME/${findPath#home/}"
-    [ -L "$linkPath" ] && continue
+    [[ -L "$linkPath" ]] && continue
     mkdir -p $(dirname "$linkPath")
     ln -s "$filePath" "$linkPath"
     echo "$linkPath"