Skip to content

Commit 1369eea

Browse files
committed
Installation of JS build tools is moved to configure_environment_recurring.sh
1 parent d7d8c19 commit 1369eea

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

scripts/provision/configure_environment.sh

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,4 @@ if [[ ${use_nfs_for_synced_folders} -eq 0 ]]; then
4949
chmod -R 755 /var/www
5050
fi
5151

52-
status "Installing js build tools"
53-
{
54-
apt-get install -y nodejs npm
55-
ln -s /usr/bin/nodejs /usr/bin/node
56-
npm install -g grunt-cli
57-
npm install gulp -g
58-
} 2> >(logError) > >(log)
59-
6052
decrementNestingLevel

scripts/provision/configure_environment_recurring.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ function isServiceAvailable() {
3939
fi
4040
}
4141

42+
function isNodeJsInstalled() {
43+
nodejs_status="$(dpkg -s nodejs | grep Status 2> >(log))"
44+
npm_status="$(dpkg -s npm | grep Status 2> >(log))"
45+
[[ ${npm_status} == "Status: install ok installed" && ${nodejs_status} == "Status: install ok installed" ]]
46+
}
47+
4248
guest_magento_dir=$2
4349
use_php7=$4
4450
vagrant_dir="/vagrant"
@@ -124,4 +130,14 @@ if [[ ${php_config_content} =~ ${pattern} ]]; then
124130
service apache2 restart 2> >(logError) > >(log)
125131
fi
126132

133+
if ! isNodeJsInstalled; then
134+
status "Installing js build tools"
135+
{
136+
apt-get install -y nodejs npm
137+
ln -s /usr/bin/nodejs /usr/bin/node
138+
npm install -g grunt-cli
139+
npm install gulp -g
140+
} 2> >(logError) > >(log)
141+
fi
142+
127143
decrementNestingLevel

0 commit comments

Comments
 (0)