summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Wagner <bwgpro@gmail.com>2014-12-03 17:04:06 -0200
committerBruno Wagner <bwgpro@gmail.com>2014-12-03 17:06:48 -0200
commitbc51867f1cfc13185681b01e2dd8f48f0f7fdeb9 (patch)
tree2d0b8e69433c546bd35972a222eb30b6c02fa0cb
parent914cde61183bc6db7fa4c5b3430e38e7b51187e2 (diff)
Updated vagrant box because bower and bundle doesn't like to be run as root
-rwxr-xr-xinstall-pixelated.sh12
-rw-r--r--provisioning/provision.sh2
2 files changed, 11 insertions, 3 deletions
diff --git a/install-pixelated.sh b/install-pixelated.sh
index 62e78703..a3ffb3e2 100755
--- a/install-pixelated.sh
+++ b/install-pixelated.sh
@@ -16,6 +16,13 @@
# along with Pixelated. If not, see <http://www.gnu.org/licenses/>.
# test dependencies
+
+
+if [ ! $USERNAME ]
+then
+ export USERNAME=`whoami`
+fi
+
function check_installed() {
which $1
if [ $? -ne 0 ]; then
@@ -31,9 +38,10 @@ done
# install web-ui dependencies
cd web-ui
+UIPATH=`pwd`
npm install
-node_modules/bower/bin/bower install --config.interactive=false
-bundle install
+su - $USERNAME -c "(cd $UIPATH; node_modules/bower/bin/bower install --config.interactive=false)"
+su - $USERNAME -c "(cd $UIPATH; bundle install)"
LC_ALL=en_US.UTF-8 ./go build
# install service dependencies
diff --git a/provisioning/provision.sh b/provisioning/provision.sh
index 63b1fabf..b269e258 100644
--- a/provisioning/provision.sh
+++ b/provisioning/provision.sh
@@ -10,4 +10,4 @@ sudo /etc/init.d/rng-tools start
cd /vagrant
-./install-pixelated.sh
+USERNAME=vagrant ./install-pixelated.sh