From 129f1472fb1cc0371e8862d806e5b83cb66c051c Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Tue, 25 Oct 2016 21:55:39 -0700 Subject: [PATCH] provision: Fix hardcoding of current user. This fixes a regression in 8e82257444666cf9daa31bc3a3b5cb5f81f85f9b and 2b8324b778a653fc420781e0afd6fe49f20ad909. --- tools/provision.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/provision.py b/tools/provision.py index 2579f8bdd6..146f8677d2 100755 --- a/tools/provision.py +++ b/tools/provision.py @@ -123,6 +123,7 @@ REPO_STOPWORDS_PATH = os.path.join( LOUD = dict(_out=sys.stdout, _err=sys.stderr) +user_id = os.getuid() def main(options): # type: (Any) -> int @@ -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: @@ -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)