Skip to content

Commit

Permalink
Link to correct directory within user's home even when running under …
Browse files Browse the repository at this point in the history
…sudo

Open-webOS-DCO-1.0-Signed-off-by: Kyle Maas kylemaasdev@gmail.com
  • Loading branch information
KyleMaas committed Jul 7, 2013
1 parent 69946d2 commit b9a09df
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
12 changes: 12 additions & 0 deletions install-webos-desktop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@ export SCRIPT_DIR=$PWD

source ./webos-desktop-common.sh

if [ -z "$BASE" ]; then
echo "You have a problem with your local.sh script which is"
echo "preventing install-luna-sysmgr.sh from locating your"
echo "binaries. Please correct the problem and try again."
exit
fi

if [ $EUID -ne 0 ]; then
echo "This script must be run as root."
exit
fi

if [ "$1" = "--help" ] ; then
echo "Usage: sudo ./install-luna-sysmgr.sh [OPTION]"
echo "Installs the luna-sysmgr component and its dependencies."
Expand Down
6 changes: 5 additions & 1 deletion local.sh.default
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@
## This has been the default target location for build-desktop since its initial creation
##

export BASE="${HOME}/luna-desktop-binaries"
if [ -z "${SUDO_USER}" ]; then
export BASE="${HOME}/luna-desktop-binaries"
else
export BASE="$(getent passwd ${SUDO_USER} | grep -o [^:]*:[^:]*$ | grep -o ^[^:]*)/luna-desktop-binaries"
fi


#########################################
Expand Down

0 comments on commit b9a09df

Please sign in to comment.