removed some unneeded uses of `sudo`

This commit is contained in:
tigerbot 2017-06-14 17:14:27 -06:00
parent bd497902f0
commit a3da998351
1 changed files with 14 additions and 11 deletions

View File

@ -216,16 +216,19 @@ my_app_launchd_service="Library/LaunchDaemons/${my_app_pkg_name}.plist"
# Install
install_my_app()
{
# This function shouldn't need to use $sudo_cmd because it is called immediately after
# /srv/walnut is chown-ed and we only mess with things in that directory.
#git clone git@git.daplie.com:Daplie/walnut.js.git
#git clone https://git.daplie.com/Daplie/walnut.js.git /srv/walnut/core
sudo mkdir -p /srv/walnut/{core,lib,var,etc,node_modules}
mkdir -p /srv/walnut/{core,lib,var,etc,node_modules}
rm -rf /srv/walnut/core/node_modules
ln -sf ../node_modules /srv/walnut/core/node_modules
sudo mkdir -p /srv/walnut/var/sites
sudo mkdir -p /srv/walnut/etc/org.oauth3.consumer
sudo mkdir -p /srv/walnut/etc/org.oauth3.provider
sudo mkdir -p /srv/walnut/etc/client-api-grants
sudo mkdir -p /srv/walnut/packages/{rest,api,pages,services}
mkdir -p /srv/walnut/var/sites
mkdir -p /srv/walnut/etc/org.oauth3.consumer
mkdir -p /srv/walnut/etc/org.oauth3.provider
mkdir -p /srv/walnut/etc/client-api-grants
mkdir -p /srv/walnut/packages/{rest,api,pages,services}
# backwards compat
if [ -d /srv/walnut/packages/client-api-grants ]; then
@ -246,14 +249,14 @@ install_my_app()
popd
}
sudo mkdir -p /srv/walnut
sudo chown -R $(whoami) /srv/walnut
$sudo_cmd mkdir -p /srv/walnut
$sudo_cmd chown -R $(whoami) /srv/walnut
install_my_app
create_skeleton
install_uninstaller
install_service
sudo chown -R www-data:www-data /srv/walnut || true
sudo chown -R _www:_www /srv/walnut || true
sudo chmod -R ug+rwX /srv/walnut
$sudo_cmd chown -R www-data:www-data /srv/walnut || true
$sudo_cmd chown -R _www:_www /srv/walnut || true
$sudo_cmd chmod -R ug+rwX /srv/walnut