From e1a0584936b3aa5ce971e875dec750d2ae937d2e Mon Sep 17 00:00:00 2001 From: Melody Horn Date: Wed, 31 Mar 2021 12:51:11 -0600 Subject: massively upgrade error handling --- src/makefile/command_line.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/makefile/command_line.rs') 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(()) } } -- cgit v1.2.3