@@ -138,8 +138,13 @@ private static function getDownloadActions(InputInterface $input, Actions $actio
138138 $ toDownload [$ action ->software ] = $ action ;
139139 }
140140
141+ $ destinationPath = $ input ->getOption ('path ' );
142+
141143 return \array_map (
142- static fn (string $ software ): DownloadConfig => $ toDownload [$ software ] ?? self ::parseSoftware ($ software ),
144+ static fn (string $ software ): DownloadConfig => $ toDownload [$ software ] ?? self ::parseSoftware (
145+ $ software ,
146+ $ destinationPath ,
147+ ),
143148 (array ) $ input ->getArgument (self ::ARG_SOFTWARE ),
144149 );
145150 }
@@ -150,16 +155,18 @@ private static function getDownloadActions(InputInterface $input, Actions $actio
150155 * Supports "name:version" format to specify exact versions.
151156 * E.g. "rr:2.10.0", "dolt:1.2.3@beta", "temporal:1.3.1-priority", etc.
152157 *
153- * @param string $software Software identifier, e.g. "rr" or "dolt:1.2.3"
158+ * @param non-empty-string $software Software identifier, e.g. "rr" or "dolt:1.2.3"
159+ * @param non-empty-string|null $destinationPath Optional path to store the binary
154160 * @return DownloadConfig Parsed download configuration
155161 */
156- private static function parseSoftware (string $ software ): DownloadConfig
162+ private static function parseSoftware (string $ software, ? string $ destinationPath ): DownloadConfig
157163 {
158164 [$ name , $ version ] = \explode (': ' , $ software , 2 ) + [1 => '' ];
159165 $ name === '' and throw new InvalidArgumentException ("Software name cannot be empty, given: {$ software }. " );
160166
161167 $ action = DownloadConfig::fromSoftwareId ($ name );
162168 $ version === '' or $ action ->version = $ version ;
169+ $ action ->extractPath = $ destinationPath ;
163170
164171 return $ action ;
165172 }
0 commit comments