summaryrefslogtreecommitdiffstats
path: root/meta/bin/update
blob: 717b9e90de7c7b3919d742c1c24397bedb25bec6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#! /bin/sh
set -euf

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 -u "#$id" "$0" "$@"
  exit 23 # go to hell
fi

git pull