From 100e7cee7cbe08f1aebd2b1d3d32a65551ff6737 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Mon, 22 May 2017 14:23:18 -0500 Subject: [PATCH] make /opt/goldilocks user-writable for install --- install.sh | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/install.sh b/install.sh index 09a8243..eb055e2 100644 --- a/install.sh +++ b/install.sh @@ -169,6 +169,7 @@ set -u dap_dl_bash "https://git.daplie.com/coolaj86/node-install-script/raw/master/setup-min.sh" # Install +# TODO install to tmp location, then move to /opt export NODE_PATH=/opt/goldilocks/lib/node_modules export NPM_CONFIG_PREFIX=/opt/goldilocks $sudo_cmd mkdir -p /etc/goldilocks @@ -176,17 +177,26 @@ $sudo_cmd mkdir -p /var/log/goldilocks $sudo_cmd mkdir -p /srv/www $sudo_cmd mkdir -p /var/www $sudo_cmd mkdir -p /opt/goldilocks/{lib,bin,etc} + +# Change to user perms + +# OS X or Linux +$sudo_cmd chown -R $(whoami) /opt/goldilocks/ || true + +npm install -g 'git+https://git@git.daplie.com/Daplie/goldilocks.js.git#v1' +# Finish up with submodule +pushd /opt/goldilocks/lib/node_modules/goldilocks +bash ./update-packages.sh +popd + +# Change to admin perms + # OS X $sudo_cmd chown _www:_www /var/www /srv/www || true $sudo_cmd chown -R _www:_www /opt/goldilocks/{lib,bin,etc} || true # Linux $sudo_cmd chown www-data:www-data /var/www /srv/www || true $sudo_cmd chown -R www-data:www-data /opt/goldilocks/{lib,bin,etc} || true -npm install -g 'git+https://git@git.daplie.com/Daplie/goldilocks.js.git#v1' -# Finish up with submodule -pushd /opt/goldilocks/lib/node_modules/goldilocks -bash ./update-packages.sh -popd # Unistall dap_dl "https://git.daplie.com/Daplie/goldilocks.js/raw/master/uninstall.sh" "./goldilocks-uninstall"