about summary refs log tree commit diff
path: root/usbify
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2016-08-01T20·02-0400
committerWilliam Carroll <wpcarro@gmail.com>2016-08-01T20·02-0400
commitace1147a82864a6a27c710af5cbccd9f1b319f20 (patch)
tree11485ade98a493e2bacd0becec87dd9c1c01afaa /usbify
parent243cb92da9e8a0f46cbe1bd36ad4ea14037ab57a (diff)
Adds null checks to script
Diffstat (limited to 'usbify')
-rw-r--r--usbify/vim/.DS_Storebin6148 -> 0 bytes
-rwxr-xr-xusbify/vim/vim_point_to_usb.sh9
2 files changed, 7 insertions, 2 deletions
diff --git a/usbify/vim/.DS_Store b/usbify/vim/.DS_Store
deleted file mode 100644
index d30ee2020845..000000000000
--- a/usbify/vim/.DS_Store
+++ /dev/null
Binary files differdiff --git a/usbify/vim/vim_point_to_usb.sh b/usbify/vim/vim_point_to_usb.sh
index e2faa9d9bf6d..98369170ffec 100755
--- a/usbify/vim/vim_point_to_usb.sh
+++ b/usbify/vim/vim_point_to_usb.sh
@@ -22,9 +22,14 @@ if [ -L "$HOME/.vim" ]; then
 else
   echo "Pointing to local machine. Toggling to USB..."
 
-  # rename the current .vim directory and .vimrc
+  # back-up local machine's .vim folder
   mv "$HOME/.vim" "$HOME/.vim.bak"
-  mv "$HOME/.vimrc" "$HOME/.vimrc.bak"
+
+  # back-up the local machine's .vimrc
+  if [ -f "HOME/.vimrc" ]; then
+    mv "$HOME/.vimrc" "$HOME/.vimrc.bak"
+  fi
+
 
   # point the $HOME/.vim name to the USB for source routing
   # use the USB drive's copy of .vimrc