MacOS default group is not user name.
This commit is contained in:
parent
69419a8f9c
commit
a24298219e
1 changed files with 8 additions and 2 deletions
10
setup.sh
10
setup.sh
|
@ -2,6 +2,12 @@
|
|||
set -e
|
||||
PROJECT_PATH=$(dirname $0)
|
||||
WHOAMI="$(id -un)"
|
||||
if [ "$(uname -s)" = "Linux" ]
|
||||
then
|
||||
MYGROUP="${WHOAMI}"
|
||||
else
|
||||
MYGROUP="staff"
|
||||
fi
|
||||
|
||||
if [ $(id -u) -eq 0 ]
|
||||
then
|
||||
|
@ -20,10 +26,10 @@ check() {
|
|||
|
||||
setup_base() {
|
||||
printf 'Change ownership of "%s" to "%s"? (setup may fail otherwise)\n' "${PROJECT_PATH}" "${WHOAMI}"
|
||||
printf 'running: "sudo chown -R %s %s"\n' "${WHOAMI}:${WHOAMI}" "${PROJECT_PATH}"
|
||||
printf 'running: "sudo chown -R %s %s"\n' "${WHOAMI}:${MYGROUP}" "${PROJECT_PATH}"
|
||||
if check 'Continue? [Y/n] '
|
||||
then
|
||||
sudo chown -R "${WHOAMI}:${WHOAMI}" "${PROJECT_PATH}"
|
||||
sudo chown -R "${WHOAMI}:${MYGROUP}" "${PROJECT_PATH}"
|
||||
fi
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue