diff options
author | Melody Horn <melody@boringcactus.com> | 2021-03-31 12:51:11 -0600 |
---|---|---|
committer | Melody Horn <melody@boringcactus.com> | 2021-03-31 12:51:11 -0600 |
commit | e1a0584936b3aa5ce971e875dec750d2ae937d2e (patch) | |
tree | f1db896b9623e6480181df3ad4792107d9d87ecf /src/makefile/command_line.rs | |
parent | d10ad4b37f726180e3da562a1fbb6cbbd106ef58 (diff) | |
download | makers-e1a0584936b3aa5ce971e875dec750d2ae937d2e.tar.gz makers-e1a0584936b3aa5ce971e875dec750d2ae937d2e.zip |
massively upgrade error handling
Diffstat (limited to 'src/makefile/command_line.rs')
-rw-r--r-- | src/makefile/command_line.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/makefile/command_line.rs b/src/makefile/command_line.rs index 20b0d25..fd1ef97 100644 --- a/src/makefile/command_line.rs +++ b/src/makefile/command_line.rs @@ -69,7 +69,7 @@ impl CommandLine { } } - pub(crate) fn execute(&self, file: &Makefile, target: &Target) { + pub(crate) fn execute(&self, file: &Makefile, target: &Target) -> anyhow::Result<()> { let ignore_error = self.ignore_errors || file.args.ignore_errors || file.special_target_has_prereq(".IGNORE", &target.name); @@ -77,7 +77,7 @@ impl CommandLine { || file.args.silent || file.special_target_has_prereq(".SILENT", &target.name); - let execution_line = file.expand_macros(&self.execution_line, Some(target)); + let execution_line = file.expand_macros(&self.execution_line, Some(target))?; if !silent { println!("{}", execution_line); @@ -86,7 +86,7 @@ impl CommandLine { let should_execute = self.always_execute || !(file.args.dry_run || file.args.question || file.args.touch); if !should_execute { - return; + return Ok(()); } let return_value = execute_command_line(&execution_line, ignore_error); @@ -98,6 +98,8 @@ impl CommandLine { panic!("error from command execution!"); } } + + Ok(()) } } |