-
Notifications
You must be signed in to change notification settings - Fork 1
/
windows-install.sh
executable file
·55 lines (43 loc) · 1.12 KB
/
windows-install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
#
# Copyright (C) 2016-2023 Joelle Maslak
# All Rights Reserved - See License
#
#
# This is intended to be run from Cygwin
# It installs vim defaults to _vim and _vimrc in the user's Windows
# home directory on Windows
#
# It also assumes that the user has already executed the Unix script
#
doit() {
# Defensive umask
if [ "$(umask)" == '0000' ] ; then
umask 0002
fi
if [ "$(uname -o)" != 'Cygwin' ] ; then
die_error "You do not appear to be executing this from Cygwin"
fi
if [ ! -f ~/.dotfiles.installed ] ; then
die_error "You must install the Unix dotfiles first"
fi
if [ "$HOMEPATH" == "" ] ; then
die_error "HOMEPATH not defined"
fi
CYGWINHOME=$(cygpath "$HOMEDRIVE$HOMEPATH")
if [ "$CYGWINHOME" == "" ] ; then
die_error "Could not determine Windows home directory"
fi
echo "User Windows home dir: $CYGWINHOME"
echo "Syncing .vim"
rsync -av ~/.vim/ "$CYGWINHOME/vimfiles/"
echo ""
echo "Syncing .vimrc"
cp ~/.vimrc "$CYGWINHOME/_vimrc"
echo ""
}
die_error() {
echo "$@" >&2
exit 1
}
doit