aboutsummaryrefslogtreecommitdiff
path: root/yapymake
diff options
context:
space:
mode:
authorMelody Horn <melody@boringcactus.com>2021-03-25 19:36:16 -0600
committerMelody Horn <melody@boringcactus.com>2021-03-25 19:36:16 -0600
commit6d3882840dbbe75820f8f0d36cca3c94079b4b33 (patch)
tree561cc09ecf27af3182083ec869b8a63542b3d2d5 /yapymake
parent4950590628a912bb9584aa7dfee8d89d22b6c32c (diff)
downloadyapymake-6d3882840dbbe75820f8f0d36cca3c94079b4b33.tar.gz
yapymake-6d3882840dbbe75820f8f0d36cca3c94079b4b33.zip
move execution check after print so dry-run actually works
Diffstat (limited to 'yapymake')
-rw-r--r--yapymake/makefile/__init__.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/yapymake/makefile/__init__.py b/yapymake/makefile/__init__.py
index 086ea2c..0a272cf 100644
--- a/yapymake/makefile/__init__.py
+++ b/yapymake/makefile/__init__.py
@@ -401,12 +401,6 @@ class CommandLine:
file.args.silent or \
file.special_target_has_prereq('.SILENT', current_target.name)
- # > If the command prefix contains a <plus-sign>, this indicates a makefile command line that shall be executed
- # > even if -n, -q, or -t is specified.
- should_execute = self.always_execute or not (file.args.dry_run or file.args.question or file.args.touch)
- if not should_execute:
- return
-
execution_line = file.expand_macros(self.execution_line, current_target)
# > Except as described under the at-sign prefix...
@@ -414,6 +408,12 @@ class CommandLine:
# > the execution line shall be written to the standard output.
print(execution_line)
+ # > If the command prefix contains a <plus-sign>, this indicates a makefile command line that shall be executed
+ # > even if -n, -q, or -t is specified.
+ should_execute = self.always_execute or not (file.args.dry_run or file.args.question or file.args.touch)
+ if not should_execute:
+ return
+
# > The execution line shall then be executed by a shell as if it were passed as the argument to the system()
# > interface, except that if errors are not being ignored then the shell -e option shall also be in effect.
# TODO figure out how to pass -e to the shell reliably
@@ -423,6 +423,7 @@ class CommandLine:
# > an error message to standard error.
if not ignore_errors and result != 0:
print('error!', file=sys.stderr)
+ # TODO implement keep-going
sys.exit(1)
BUILTIN_INFERENCE_RULES = [