@@ -314,7 +314,7 @@ use crate::commands::apt::{download_package, find_package};
314
314
use crate :: priority:: get_priority;
315
315
use crate :: set:: set:: file_create_time;
316
316
use crate :: run:: run;
317
- use crate :: state_code:: { empty_dir, empty_file, env, missing_pattern, STATUE_CODE } ;
317
+ use crate :: start :: state_code:: { empty_dir, empty_file, env, missing_pattern, STATUE_CODE } ;
318
318
use super :: apt:: { update, update_last} ;
319
319
use crate :: root:: SessionContext ;
320
320
@@ -538,16 +538,20 @@ pub fn pipe(command:Vec<String>) -> io::Result<(usize,String)>{
538
538
}
539
539
540
540
// &&
541
- pub fn and ( command : Vec < String > , session_context : & mut SessionContext ) {
541
+ pub fn and ( command : Vec < String > , session_context : & mut SessionContext ) -> Vec < String > {
542
+ let mut output: Vec < _ > = Vec :: new ( ) ;
542
543
let commands = command. split ( |x| x=="&&" ) ;
543
544
for c in commands{
544
545
let v = c. to_vec ( ) ;
545
- run ( v, session_context)
546
+ let r = run ( v, session_context) ;
547
+ output. push ( r)
546
548
}
549
+ output
547
550
}
548
551
549
552
// &
550
- pub fn priority_run ( command : Vec < String > , session_context : & mut SessionContext ) {
553
+ pub fn priority_run ( command : Vec < String > , session_context : & mut SessionContext ) -> Vec < String > {
554
+ let mut output: Vec < _ > = Vec :: new ( ) ;
551
555
let commands = command. split ( |x| x=="&" ) ;
552
556
let mut save_command = Vec :: new ( ) ;
553
557
for c in commands{
@@ -558,8 +562,10 @@ pub fn priority_run(command:Vec<String>,session_context: &mut SessionContext){
558
562
save_command. sort_by_key ( |c| -( get_priority ( & c[ 0 ] ) . as_number ( ) as i32 ) ) ;
559
563
560
564
for c in save_command{
561
- run ( c, session_context)
565
+ let r = run ( c, session_context) ;
566
+ output. push ( r)
562
567
}
568
+ output
563
569
}
564
570
565
571
fn get_env ( id : String ) -> String {
0 commit comments