-
Notifications
You must be signed in to change notification settings - Fork 9
/
assemble.sh
executable file
·41 lines (36 loc) · 1.38 KB
/
assemble.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
#!/bin/sh
# WHAT: This script assembles the vim-hashicorp-tools plugin from git checkouts
# of the constituent plugins, which are assumed to exist in the same
# directory as vim-hashicorp-tools.
BLD=$(tput bold)
RST=$(tput sgr0)
for REPO in consul nomadproject ottoproject packer terraform vagrant vaultproject; do
# Clone all the repositories just incase we didn't have them
if [ ! -d "../vim-${REPO}" ]; then
echo "${BLD}INFO: Cloning vim-${REPO}${RST}"
git clone [email protected]:hashivim/vim-${REPO} ../vim-${REPO}
fi
# We only want to assemble off of master
if [ $(cd ../vim-${REPO} && git rev-parse --abbrev-ref HEAD) != "master" ]; then
echo "${BLD}WARN: Repository vim-${REPO} did not have the master branch checked out. To get that branchs changes back, run \`stash pop\`.${RST}"
git stash
git checkout master
git pull
fi
# Hashicorp tools ASSEMBLE!
echo "${BLD}INFO: Assembling ../vim-${REPO} into this repository.${RST}"
rsync --archive \
--exclude=.git \
--exclude=*.md \
--exclude=LICENSE \
--exclude=*.rb \
--exclude=*.sh \
--exclude=.travis.yml \
--exclude=Makefile \
--exclude=test/ \
--exclude=vader.vim/ \
--exclude=terraform-providers/ \
../vim-${REPO}/ .
done
echo "${BLD}INFO: Done!${RST}"
git status