From ace1147a82864a6a27c710af5cbccd9f1b319f20 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Mon, 1 Aug 2016 16:02:14 -0400 Subject: [PATCH] Adds null checks to script --- usbify/vim/.DS_Store | Bin 6148 -> 0 bytes usbify/vim/vim_point_to_usb.sh | 9 +++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) delete mode 100644 usbify/vim/.DS_Store diff --git a/usbify/vim/.DS_Store b/usbify/vim/.DS_Store deleted file mode 100644 index d30ee202084538124bbb4acc623c6fa172887fd7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK%}(Pm5VlJfQs5A@i$L0ouSgXtzrAL=a73z{}PN1c*_ z@gQ>S!ylv_KT3S4|C@>?$7^H&*RIIcS)WOEa)15&P9)Q;Qn}-Wnc|1pIjb~3zX*@L zw0PvUlYyIgSud@5-5;tZgU~m2-OJiz`&*Jk6Wj9}G90w*PhXQb^JE-$@1-6#WgH}f zTGESy^w8D)HD!>sTlR9j8}=c!?!{q4rqY*@%zl+h7CbF`WjNg4DT~d`>ZmM+)oP_I zwzqaiBm2~{KCkV3Ir!cg{XRRtxV*al^Y=zC0*CKa$wz}@xCLXvN8jznQ4;?I-#C68 zM@S411H`~vX29%e*1}t!1id>kKny$!1Gqm3P(;UIu2F3rP~h()wigjmz{a}-qA=(f z%r!y_2-m5AI+dF%2G{A}7beazm}}JOjH{8MA2TvHHx#Z$2ft9^j5`{sBnF6qhYZZ< zs*UIW{?qsWhe=c;28e-o#Q-nvxqCI3k~v$aCWmLO06hjp!MI%GBn1q06hkZ?#jBu7 Zz%S4MbPVPi!2?1+0*VGIh=CVn;6E4;V@Ci0 diff --git a/usbify/vim/vim_point_to_usb.sh b/usbify/vim/vim_point_to_usb.sh index e2faa9d9b..98369170f 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