@@ -13,7 +13,6 @@ use crate::console::StdConsoleWriter;
1313/// Service for executing shell commands
1414#[ derive( Clone , Debug ) ]
1515pub struct ForgeCommandExecutorService {
16- restricted : bool ,
1716 env : Environment ,
1817 output_printer : Arc < StdConsoleWriter > ,
1918
@@ -22,13 +21,8 @@ pub struct ForgeCommandExecutorService {
2221}
2322
2423impl ForgeCommandExecutorService {
25- pub fn new ( restricted : bool , env : Environment , output_printer : Arc < StdConsoleWriter > ) -> Self {
26- Self {
27- restricted,
28- env,
29- output_printer,
30- ready : Arc :: new ( Mutex :: new ( ( ) ) ) ,
31- }
24+ pub fn new ( env : Environment , output_printer : Arc < StdConsoleWriter > ) -> Self {
25+ Self { env, output_printer, ready : Arc :: new ( Mutex :: new ( ( ) ) ) }
3226 }
3327
3428 fn prepare_command (
@@ -39,11 +33,7 @@ impl ForgeCommandExecutorService {
3933 ) -> Command {
4034 // Create a basic command
4135 let is_windows = cfg ! ( target_os = "windows" ) ;
42- let shell = if self . restricted && !is_windows {
43- "rbash"
44- } else {
45- self . env . shell . as_str ( )
46- } ;
36+ let shell = self . env . shell . as_str ( ) ;
4737 let mut command = Command :: new ( shell) ;
4838
4939 // Core color settings for general commands
@@ -265,7 +255,7 @@ mod tests {
265255
266256 #[ tokio:: test]
267257 async fn test_command_executor ( ) {
268- let fixture = ForgeCommandExecutorService :: new ( false , test_env ( ) , test_printer ( ) ) ;
258+ let fixture = ForgeCommandExecutorService :: new ( test_env ( ) , test_printer ( ) ) ;
269259 let cmd = "echo 'hello world'" ;
270260 let dir = "." ;
271261
@@ -297,7 +287,7 @@ mod tests {
297287 std:: env:: set_var ( "ANOTHER_TEST_VAR" , "another_value" ) ;
298288 }
299289
300- let fixture = ForgeCommandExecutorService :: new ( false , test_env ( ) , test_printer ( ) ) ;
290+ let fixture = ForgeCommandExecutorService :: new ( test_env ( ) , test_printer ( ) ) ;
301291 let cmd = if cfg ! ( target_os = "windows" ) {
302292 "echo %TEST_ENV_VAR%"
303293 } else {
@@ -330,7 +320,7 @@ mod tests {
330320 std:: env:: remove_var ( "MISSING_ENV_VAR" ) ;
331321 }
332322
333- let fixture = ForgeCommandExecutorService :: new ( false , test_env ( ) , test_printer ( ) ) ;
323+ let fixture = ForgeCommandExecutorService :: new ( test_env ( ) , test_printer ( ) ) ;
334324 let cmd = if cfg ! ( target_os = "windows" ) {
335325 "echo %MISSING_ENV_VAR%"
336326 } else {
@@ -353,7 +343,7 @@ mod tests {
353343
354344 #[ tokio:: test]
355345 async fn test_command_executor_with_empty_env_list ( ) {
356- let fixture = ForgeCommandExecutorService :: new ( false , test_env ( ) , test_printer ( ) ) ;
346+ let fixture = ForgeCommandExecutorService :: new ( test_env ( ) , test_printer ( ) ) ;
357347 let cmd = "echo 'no env vars'" ;
358348
359349 let actual = fixture
@@ -377,7 +367,7 @@ mod tests {
377367 std:: env:: set_var ( "SECOND_VAR" , "second" ) ;
378368 }
379369
380- let fixture = ForgeCommandExecutorService :: new ( false , test_env ( ) , test_printer ( ) ) ;
370+ let fixture = ForgeCommandExecutorService :: new ( test_env ( ) , test_printer ( ) ) ;
381371 let cmd = if cfg ! ( target_os = "windows" ) {
382372 "echo %FIRST_VAR% %SECOND_VAR%"
383373 } else {
@@ -407,7 +397,7 @@ mod tests {
407397
408398 #[ tokio:: test]
409399 async fn test_command_executor_silent ( ) {
410- let fixture = ForgeCommandExecutorService :: new ( false , test_env ( ) , test_printer ( ) ) ;
400+ let fixture = ForgeCommandExecutorService :: new ( test_env ( ) , test_printer ( ) ) ;
411401 let cmd = "echo 'silent test'" ;
412402 let dir = "." ;
413403
0 commit comments