forked from e-mission/e-mission-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
start_devapp_serve.sh
executable file
·35 lines (29 loc) · 1.2 KB
/
start_devapp_serve.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
#!/usr/bin/env bash
#Configure web server
#set phone repo using environment variable
echo "Cloning from repo "${PHONE_REPO}" and branch "$PHONE_BRANCH
mkdir -p /src
cd /src
git clone $PHONE_REPO
cd e-mission-phone
git clone https://github.com/driftyco/ionic-package-hooks.git ./package-hooks
git fetch origin $PHONE_BRANCH
git checkout -f $PHONE_BRANCH
node ./bin/configure_xml_and_json.js serve
echo "About to install node modules"
npm install
echo "About to install bower modules"
bower install --allow-root
# chmod a+x hooks/before_prepare/download_translation.js
# npm run sass-build
echo "About to fix autoreload script"
ORIG="path.join(process.cwd(), 'www/../.')"
NEW="path.join(process.cwd(), 'www/js/**/*'), path.join(process.cwd(), 'www/templates/**/*')"
echo "Replacing $ORIG -> $NEW"
sed -i -e "s|$ORIG|$NEW|g" /src/e-mission-phone/node_modules//connect-phonegap/lib/middleware/autoreload.js
grep "path.join" /src/e-mission-phone/node_modules//connect-phonegap/lib/middleware/autoreload.js
# cp /autoreload.js /src/e-mission-phone/node_modules//connect-phonegap/lib/middleware/
# cp /chokidar-index.js /src/e-mission-phone/node_modules/chokidar/index.js
# launch the webapp
npm run setup-serve
npm run serve