File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33namespace docker ;
44
55use Castor \Attribute \AsOption ;
6+ use Castor \Attribute \AsRawTokens ;
67use Castor \Attribute \AsTask ;
78use Castor \Context ;
89use Castor \Helper \PathHelper ;
@@ -153,16 +154,21 @@ function stop(
153154 docker_compose ($ command , profiles: $ profiles );
154155}
155156
156- #[AsTask(description: 'Opens a shell (bash) into a builder container ' , aliases: ['builder ' ])]
157- function builder (): void
157+ /**
158+ * @param array<string> $params
159+ */
160+ #[AsTask(description: 'Opens a shell (bash) or proxy any command to the builder container ' , aliases: ['builder ' ])]
161+ function builder (#[AsRawTokens] array $ params = []): void
158162{
163+ if (0 === \count ($ params )) {
164+ $ params = ['bash ' ];
165+ }
166+
159167 $ c = context ()
160- ->withTimeout (null )
161- ->withTty ()
168+ ->toInteractive ()
162169 ->withEnvironment ($ _ENV + $ _SERVER )
163- ->withAllowFailure ()
164170 ;
165- docker_compose_run (' bash ' , c: $ c );
171+ docker_compose_run (implode ( ' ' , $ params ) , c: $ c );
166172}
167173
168174/**
You can’t perform that action at this time.
0 commit comments