Skip to content

Commit

Permalink
Improved error message when script is not run under root privs
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardoquesada committed Apr 24, 2010
1 parent c4aa4cd commit 0dcb998
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion install-templates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ BASE_TEMPLATE_DIR="/Library/Application Support/Developer/Shared/Xcode"

# Make sure only root can run our script
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root in order to copy templates to ${BASE_TEMPLATE_DIR}" 1>&2
echo ""
echo "Error: This script must be run as root in order to copy templates to ${BASE_TEMPLATE_DIR}" 1>&2
echo ""
echo "Try running it with 'sudo':" 1>&2
echo " sudo $0" 1>&2
exit 1
fi

Expand Down

0 comments on commit 0dcb998

Please sign in to comment.