Get rid of batch file for smarter shell script that can push out to win32 vim

Thu, 07 Aug 2014 16:46:00 -0400

author
Meredith Howard <mhoward@roomag.org>
date
Thu, 07 Aug 2014 16:46:00 -0400
changeset 130
906ce6af31f6
parent 129
390622b4e667
child 131
48cbd22dfde9

Get rid of batch file for smarter shell script that can push out to win32 vim

.vim/windows-vimfiles.bat file | annotate | diff | comparison | revisions
.vim/windows-vimfiles.sh file | annotate | diff | comparison | revisions
deleted file mode 100644
--- a/.vim/windows-vimfiles.bat
+++ /dev/null
@@ -1,4 +0,0 @@
-@ECHO ON
-
-copy ..\.vimrc %USERPROFILE%\_vimrc
-xcopy /s ..\.vim %USERPROFILE%\vimfiles\
new file mode 100644
--- /dev/null
+++ b/.vim/windows-vimfiles.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+set -euo pipefail
+IFS=$'\n\t'
+
+if [ ! -L ~/userprofile ]; then
+  echo "Please link ~/userprofile"
+fi
+
+USERPROFILE="$(readlink ~/userprofile)"
+
+cd `hg root`
+
+cp -vu .vimrc ${USERPROFILE}/_vimrc
+
+if [ ! -d ${USERPROFILE}/vimfiles ]; then
+  mkdir ${USERPROFILE}/vimfiles
+fi
+
+cp -vuRL -t ${USERPROFILE}/vimfiles .vim/*
+

mercurial