forked from bjoernd/vim-syntax-simics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webinstall.sh
37 lines (31 loc) · 1.09 KB
/
webinstall.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
#!/bin/sh
# Install script for Simics syntax highlighting in VIM
set -e
set -u
# Installation will put two files in place under $INSTALLDIR
# syntax/simics.vim == highlighting
# ftdetect/simics.vim == filetype detection
SOURCE=https://raw.github.com/mjwade/vim-syntax-simics/master
INSTALLDIR=$HOME/.vim
echo -e "Installing vim-syntax-simics"
# Create the needed paths and files
echo -e "\t-Making subdirs in $HOME/.vim"
mkdir -p $INSTALLDIR/syntax/
if [ $? -ne 0 ]; then #failed
EXITCODE=$?
echo "failed to mkdir -p on $INSTALLDIR/syntax/simics.vim"
exit $EXITCODE
fi
mkdir -p $INSTALLDIR/ftdetect/
if [ $? -ne 0 ]; then #failed
EXITCODE=$?
echo "failed to mkdir -p on $INSTALLDIR/ftdetect/simics.vim"
exit $EXITCODE
fi
# Fill the files
# NOTE: Assumes you're running this from the web...
echo -e "\t-Fetching the vim-simics files from the web"
curl --raw --silent $SOURCE/syntax/simics.vim > $INSTALLDIR/syntax/simics.vim
curl --raw --silent $SOURCE/ftdetect/simics.vim > $INSTALLDIR/ftdetect/simics.vim
# Stuff should be in the files now...
echo "Installation is complete. Enjoy!"