diff options
author | Bert Belder <bertbelder@gmail.com> | 2018-09-02 20:00:25 +0200 |
---|---|---|
committer | Bert Belder <bertbelder@gmail.com> | 2018-09-05 01:24:55 +0200 |
commit | 2c0d00840d09ce6d8f2b8615c9682ce4dfbfdb9d (patch) | |
tree | eeaaafe3f78b756a21c556e4bedc7e9b71635eae | |
parent | 131a8a9b0e6275e8f2688e083932a5e01d326dd3 (diff) |
tools/build: skip build path detection when given '-C «dir»' ninja arg
-rwxr-xr-x | tools/build.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tools/build.py b/tools/build.py index 978b70a36..9de84f541 100755 --- a/tools/build.py +++ b/tools/build.py @@ -1,20 +1,20 @@ #!/usr/bin/env python # Copyright 2018 the Deno authors. All rights reserved. MIT license. +from __future__ import print_function import os import sys -from os.path import join import third_party -from util import root_path, run, run_output, build_path +from util import build_path, run third_party.fix_symlinks() -print "DENO_BUILD_PATH:", build_path() -if not os.path.isdir(build_path()): - print "DENO_BUILD_PATH does not exist. Run tools/setup.py" - sys.exit(1) -os.chdir(build_path()) - ninja_args = sys.argv[1:] +if not "-C" in ninja_args: + if not os.path.isdir(build_path()): + print("Build directory '%s' does not exist." % build_path(), + "Run tools/setup.py") + sys.exit(1) + ninja_args = ["-C", build_path()] + ninja_args run([third_party.ninja_path] + ninja_args, env=third_party.google_env(), |