diff options
Diffstat (limited to 'meta/bin')
-rwxr-xr-x | meta/bin/update | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/meta/bin/update b/meta/bin/update index 98a69257..717b9e90 100755 --- a/meta/bin/update +++ b/meta/bin/update @@ -1,12 +1,15 @@ #! /bin/sh set -euf -if test "${nosudo-false}" != true -a `id -u` != 0; then +cd $(dirname $(readlink -f $0))/../.. +id=`ls -lnd . | awk '{print$3}'` + +echo "// is $PWD owned by $id" + +if test "${nosudo-false}" != true -a `id -u` != $id; then echo "we're going sudo..." >&2 - exec sudo "$0" "$@" + exec sudo -u "#$id" "$0" "$@" exit 23 # go to hell fi -set -x -cd $(dirname $(readlink -f $0))` git pull |