@@ -36,10 +36,6 @@ pub(crate) struct Recipe<'src, D = Dependency<'src>> {
3636 pub ( crate ) private : bool ,
3737 pub ( crate ) quiet : bool ,
3838 pub ( crate ) shebang : bool ,
39- #[ serde( skip) ]
40- pub ( crate ) submodule_depth : u32 ,
41- #[ serde( skip) ]
42- pub ( crate ) working_directory : PathBuf ,
4339}
4440
4541impl < ' src , D > Recipe < ' src , D > {
@@ -137,20 +133,10 @@ impl<'src, D> Recipe<'src, D> {
137133 }
138134
139135 fn working_directory < ' a > ( & ' a self , context : & ' a ExecutionContext ) -> Option < PathBuf > {
140- if !self . change_directory ( ) {
141- return None ;
142- }
143-
144- let base = if self . submodule_depth > 0 {
145- & self . working_directory
136+ if self . change_directory ( ) {
137+ Some ( context. working_directory ( ) )
146138 } else {
147- & context. search . working_directory
148- } ;
149-
150- if let Some ( setting) = & context. settings . working_directory {
151- Some ( base. join ( setting) )
152- } else {
153- Some ( base. into ( ) )
139+ None
154140 }
155141 }
156142
@@ -205,8 +191,8 @@ impl<'src, D> Recipe<'src, D> {
205191 let quiet_line = lines. peek ( ) . map_or ( false , |line| line. is_quiet ( ) ) ;
206192 let infallible_line = lines. peek ( ) . map_or ( false , |line| line. is_infallible ( ) ) ;
207193
208- let comment_line =
209- context . settings . ignore_comments && lines. peek ( ) . map_or ( false , |line| line. is_comment ( ) ) ;
194+ let comment_line = context . module . settings . ignore_comments
195+ && lines. peek ( ) . map_or ( false , |line| line. is_comment ( ) ) ;
210196
211197 loop {
212198 if lines. peek ( ) . is_none ( ) {
@@ -242,7 +228,7 @@ impl<'src, D> Recipe<'src, D> {
242228 if config. dry_run
243229 || config. verbosity . loquacious ( )
244230 || !( ( quiet_line ^ self . quiet )
245- || ( context. settings . quiet && !self . no_quiet ( ) )
231+ || ( context. module . settings . quiet && !self . no_quiet ( ) )
246232 || config. verbosity . quiet ( ) )
247233 {
248234 let color = config
@@ -269,15 +255,15 @@ impl<'src, D> Recipe<'src, D> {
269255 continue ;
270256 }
271257
272- let mut cmd = context. settings . shell_command ( config) ;
258+ let mut cmd = context. module . settings . shell_command ( config) ;
273259
274260 if let Some ( working_directory) = self . working_directory ( context) {
275261 cmd. current_dir ( working_directory) ;
276262 }
277263
278264 cmd. arg ( command) ;
279265
280- if self . takes_positional_arguments ( context. settings ) {
266+ if self . takes_positional_arguments ( & context. module . settings ) {
281267 cmd. arg ( self . name . lexeme ( ) ) ;
282268 cmd. args ( positional) ;
283269 }
@@ -287,7 +273,12 @@ impl<'src, D> Recipe<'src, D> {
287273 cmd. stdout ( Stdio :: null ( ) ) ;
288274 }
289275
290- cmd. export ( context. settings , context. dotenv , scope, context. unexports ) ;
276+ cmd. export (
277+ & context. module . settings ,
278+ context. dotenv ,
279+ scope,
280+ & context. module . unexports ,
281+ ) ;
291282
292283 match InterruptHandler :: guard ( || cmd. status ( ) ) {
293284 Ok ( exit_status) => {
@@ -356,7 +347,7 @@ impl<'src, D> Recipe<'src, D> {
356347 Executor :: Command (
357348 interpreter
358349 . as_ref ( )
359- . or ( context. settings . script_interpreter . as_ref ( ) )
350+ . or ( context. module . settings . script_interpreter . as_ref ( ) )
360351 . unwrap_or_else ( || Interpreter :: default_script_interpreter ( ) ) ,
361352 )
362353 } else {
@@ -372,7 +363,7 @@ impl<'src, D> Recipe<'src, D> {
372363
373364 let mut tempdir_builder = tempfile:: Builder :: new ( ) ;
374365 tempdir_builder. prefix ( "just-" ) ;
375- let tempdir = match & context. settings . tempdir {
366+ let tempdir = match & context. module . settings . tempdir {
376367 Some ( tempdir) => tempdir_builder. tempdir_in ( context. search . working_directory . join ( tempdir) ) ,
377368 None => {
378369 if let Some ( runtime_dir) = dirs:: runtime_dir ( ) {
@@ -420,11 +411,16 @@ impl<'src, D> Recipe<'src, D> {
420411 self . working_directory ( context) . as_deref ( ) ,
421412 ) ?;
422413
423- if self . takes_positional_arguments ( context. settings ) {
414+ if self . takes_positional_arguments ( & context. module . settings ) {
424415 command. args ( positional) ;
425416 }
426417
427- command. export ( context. settings , context. dotenv , scope, context. unexports ) ;
418+ command. export (
419+ & context. module . settings ,
420+ context. dotenv ,
421+ scope,
422+ & context. module . unexports ,
423+ ) ;
428424
429425 // run it!
430426 match InterruptHandler :: guard ( || command. status ( ) ) {
0 commit comments