Skip to content

Commit

Permalink
provision: Fix hardcoding of current user.
Browse files Browse the repository at this point in the history
This fixes a regression in 8e82257
and 2b8324b.
  • Loading branch information
timabbott committed Oct 26, 2016
1 parent 1a927a4 commit 129f147
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tools/provision.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@

LOUD = dict(_out=sys.stdout, _err=sys.stderr)

user_id = os.getuid()

def main(options):
# type: (Any) -> int
Expand Down Expand Up @@ -176,7 +177,7 @@ def main(options):

run(["tools/setup/download-zxcvbn"])
if os.path.isdir(EMOJI_CACHE_PATH):
run(["sudo", "chown", "zulip:zulip", EMOJI_CACHE_PATH])
run(["sudo", "chown", "%s:%s" % (user_id, user_id), EMOJI_CACHE_PATH])
run(["python", "tools/setup/emoji_dump/build_emoji"])
run(["scripts/setup/generate_secrets.py", "--development"])
if options.is_travis and not options.is_production_travis:
Expand Down Expand Up @@ -217,7 +218,7 @@ def main(options):
if os.path.islink("node_modules"):
run(["sudo", "rm", "-f", "node_modules"])
if os.path.isdir(NPM_CACHE_PATH):
run(["sudo", "chown", "zulip:zulip", NPM_CACHE_PATH])
run(["sudo", "chown", "%s:%s" % (user_id, user_id), NPM_CACHE_PATH])
setup_node_modules()
except subprocess.CalledProcessError:
print(WARNING + "`npm install` failed; retrying..." + ENDC)
Expand Down

0 comments on commit 129f147

Please sign in to comment.