]> ruderich.org/simon Gitweb - config/dotfiles.git/commitdiff
lib.sh: abort if cd fails
authorSimon Ruderich <simon@ruderich.org>
Sun, 3 Jun 2018 16:18:20 +0000 (18:18 +0200)
committerSimon Ruderich <simon@ruderich.org>
Sun, 3 Jun 2018 16:18:20 +0000 (18:18 +0200)
lib.sh

diff --git a/lib.sh b/lib.sh
index 1ce0c33c4e96468aab048bf1b40d3997ab486819..0329a0f05a4cc85965ca36af9a07b4749ef58f1b 100644 (file)
--- a/lib.sh
+++ b/lib.sh
@@ -168,7 +168,7 @@ link() {
     ln -s "$source" "$target"
 
     # Go back to the directory where we were before.
-    cd "$pwd"
+    cd "$pwd" || return 1
 }
 
 # Generate a file from a source file using a given command. A warning not to