From 110029ce3b7f205cce01f7d74dd2c8777f860c31 Mon Sep 17 00:00:00 2001 From: Melody Horn Date: Tue, 6 Apr 2021 16:20:09 -0600 Subject: implement exported variables --- src/makefile/command_line.rs | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'src/makefile/command_line.rs') diff --git a/src/makefile/command_line.rs b/src/makefile/command_line.rs index ec2c115..1b4b4b4 100644 --- a/src/makefile/command_line.rs +++ b/src/makefile/command_line.rs @@ -1,16 +1,20 @@ use std::env; use std::fmt; -use std::io; use std::process::{Command, ExitStatus}; -use eyre::bail; +use eyre::{bail, Error}; -use crate::makefile::target::Target; -use crate::makefile::token::{Token, TokenString}; -use crate::makefile::Makefile; +use super::r#macro::Set as MacroSet; +use super::target::Target; +use super::token::{Token, TokenString}; +use super::Makefile; // inspired by python's subprocess module -fn execute_command_line(command_line: &str, ignore_errors: bool) -> Result { +fn execute_command_line( + command_line: &str, + ignore_errors: bool, + macros: &MacroSet, +) -> Result { let (program, args) = if cfg!(windows) { let cmd = env::var("COMSPEC").unwrap_or_else(|_| "cmd.exe".into()); let args = vec!["/c", command_line]; @@ -24,7 +28,11 @@ fn execute_command_line(command_line: &str, ignore_errors: bool) -> Result