diff options
author | kennyballou <kballou@onyx.boisestate.edu> | 2013-03-08 17:45:31 -0700 |
---|---|---|
committer | kennyballou <kballou@onyx.boisestate.edu> | 2013-03-08 17:45:31 -0700 |
commit | d94ee682a518ad13b71e8423a8a9bd86ce4a8648 (patch) | |
tree | 2f56f57f91872bccbb6633cd42006eac1251b1c9 /xnt | |
parent | c042dd904676c96dbee08b6eaa4b2effa20baca3 (diff) | |
download | xnt-d94ee682a518ad13b71e8423a8a9bd86ce4a8648.tar.gz xnt-d94ee682a518ad13b71e8423a8a9bd86ce4a8648.tar.xz |
Update `xntcall` to change working directory
I can't make any assumptions about what sub code is called, therefore it is
safer (and easy enough) to have xnt change the working directory before
invoking the sub build
Diffstat (limited to 'xnt')
-rw-r--r-- | xnt/commands/target.py | 2 | ||||
-rw-r--r-- | xnt/tasks.py | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/xnt/commands/target.py b/xnt/commands/target.py index ca6f7fe..0520c74 100644 --- a/xnt/commands/target.py +++ b/xnt/commands/target.py @@ -62,7 +62,7 @@ class TargetCommand(Command): except AttributeError: return None try: - if len(props) > 0: + if props and len(props) > 0: setattr(self.build, "properties", process_params(props, __get_properties())) diff --git a/xnt/tasks.py b/xnt/tasks.py index a647b0b..1fdc0da 100644 --- a/xnt/tasks.py +++ b/xnt/tasks.py @@ -129,8 +129,12 @@ def xntcall(path, targets=None, props=None): """ import xnt.xenant from xnt.commands.target import TargetCommand + cwd = os.getcwd() command = TargetCommand(xnt.xenant.load_build(path)) - return command.run(targets=targets, props=props) + os.chdir(path) + error_code = command.run(targets=targets, props=props) + os.chdir(cwd) + return error_code def call(command, stdout=None, stderr=None): """ Execute the given command, redirecting stdout and stderr |