Skip to content

Commit

Permalink
provision: Fix creation of cache directories.
Browse files Browse the repository at this point in the history
  • Loading branch information
timabbott committed Oct 27, 2016
1 parent 486774b commit 76fd7c0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tools/provision.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,9 @@ def main(options):
run(["mkdir", "-p", NODE_TEST_COVERAGE_DIR_PATH])

run(["tools/setup/download-zxcvbn"])
if os.path.isdir(EMOJI_CACHE_PATH):
run(["sudo", "chown", "%s:%s" % (user_id, user_id), EMOJI_CACHE_PATH])
if not os.path.isdir(EMOJI_CACHE_PATH):
run(["sudo", "mkdir", 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,8 +218,9 @@ def main(options):
# issue with the symlinks being improperly owned by root.
if os.path.islink("node_modules"):
run(["sudo", "rm", "-f", "node_modules"])
if os.path.isdir(NPM_CACHE_PATH):
run(["sudo", "chown", "%s:%s" % (user_id, user_id), NPM_CACHE_PATH])
if not os.path.isdir(NPM_CACHE_PATH):
run(["sudo", "mkdir", 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 76fd7c0

Please sign in to comment.