-
Notifications
You must be signed in to change notification settings - Fork 3
/
setup
executable file
·71 lines (62 loc) · 1.78 KB
/
setup
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/usr/bin/env bash
#
# Sets up the development environment for Bedrock
# Collect a list of all of the repositories
NPM_REPOS=`cat package.json | sed -n "/cloneRepos/,/\},/p" | sed '$d' | tail -n+2 | tr -d '"' | tr -d ',' | tr -d ' '`
BOWER_REPOS=`cat bower.json | sed -n "/cloneRepos/,/\},/p" | sed '$d' | tail -n+2 | tr -d '"' | tr -d ',' | tr -d ' '`
# Clone all of the repositories
echo -n "Cloning all repositories..."
for line in $NPM_REPOS $BOWER_REPOS;
do
REPO_NAME=`echo $line | cut -f1 -d:`
REPO_URL=`echo $line | cut -f2- -d: | cut -f1 -d#`
if [ ! -d $REPO_NAME ]; then
echo -n "."
git clone -q $REPO_URL $REPO_NAME
fi
done
echo "done."
# Install all of the non-bedrock NPM repositories
echo "Performing base npm install..."
npm install
# Install all of the non-bedrock bower repositories
echo "Performing base bower install..."
./node_modules/.bin/bower install
# Link all of the NPM repositories and do an npm install in each
cd node_modules
for line in $NPM_REPOS;
do
REPO_NAME=`echo $line | cut -f1 -d:`
REPO_BRANCH=`echo $line | cut -f2 -d#`
echo -e "\nLinking $REPO_NAME ($REPO_BRANCH)..."
ln -sf ../$REPO_NAME $REPO_NAME
cd $REPO_NAME
git checkout -q $REPO_BRANCH
cd ..
done
cd ..
# npm install in each repository
cd node_modules
for line in $NPM_REPOS;
do
REPO_NAME=`echo $line | cut -f1 -d:`
REPO_BRANCH=`echo $line | cut -f2 -d#`
echo -e "\nInstalling $REPO_NAME ($REPO_BRANCH)..."
cd $REPO_NAME
npm update
cd ..
done
cd ..
# Link all of the bower repositories
echo -n "Linking bower repositories..."
cd bower_components
for line in $BOWER_REPOS;
do
REPO_NAME=`echo $line | cut -f1 -d:`
ln -sf ../$REPO_NAME $REPO_NAME
done
cd ..
echo "done."
# Compile less
node ./index.js compile-less
echo -e "\nSetup complete, try this: node index.js"