@@ -410,8 +410,20 @@ func (f *fetcher) fetchTool(tool *types.Tool, toolName string, url string, tmpDi
410
410
if ! extracted {
411
411
downloadedName = fileName
412
412
}
413
+ if err = f .moveToTarget (tool , toolName , targetDir , dir , downloadedName , false ); err != nil {
414
+ return err
415
+ }
416
+
417
+ for _ , add := range tool .Additional {
418
+ if toolName != add {
419
+ if err = f .moveToTarget (tool , add , targetDir , dir , add , true ); err != nil {
420
+ return err
421
+ }
422
+ }
423
+ }
424
+
425
+ return nil
413
426
414
- return f .moveToTarget (tool , toolName , targetDir , dir , downloadedName )
415
427
}
416
428
417
429
func (f * fetcher ) validate (targetPath string , check string ) error {
@@ -446,6 +458,7 @@ func (f *fetcher) moveToTarget(
446
458
targetDir string ,
447
459
dir string ,
448
460
downloadedName string ,
461
+ isAdditional bool ,
449
462
) error {
450
463
targetFilePath , err := filepath .Abs (filepath .Join (targetDir , trueToolName ))
451
464
if err != nil {
@@ -463,7 +476,7 @@ func (f *fetcher) moveToTarget(
463
476
if err != nil {
464
477
return err
465
478
}
466
- if ! ok {
479
+ if ! ok && ! isAdditional {
467
480
return fmt .Errorf ("could not find: %s" , downloadedName )
468
481
}
469
482
return nil
@@ -484,28 +497,29 @@ func (f *fetcher) copyTool(
484
497
for _ , file := range files {
485
498
if file .IsDir () {
486
499
dirs = append (dirs , file )
487
- }
488
- if fileMatches (file , fileName ) {
500
+ } else {
501
+ if fileMatches (file , fileName ) {
489
502
490
- sourcePath := filepath .Join (dir , file .Name ())
491
- targetPath := filepath .Join (targetDir , binaryName (targetName ))
503
+ sourcePath := filepath .Join (dir , file .Name ())
504
+ targetPath := filepath .Join (targetDir , binaryName (targetName ))
492
505
493
- if err := copyFile (sourcePath , targetPath ); err != nil {
494
- return false , err
495
- }
496
- if err := f .validate (targetPath , tool .Check ); err != nil {
497
- return true , err
498
- }
506
+ if err := copyFile (sourcePath , targetPath ); err != nil {
507
+ return false , err
508
+ }
509
+ if err := f .validate (targetPath , tool .Check ); err != nil {
510
+ return true , err
511
+ }
499
512
500
- if f .upx {
501
- if tool .SkipUpx {
502
- log .Printf ("⏭️️ Skipping upx compression" )
503
- } else {
504
- f .upxCompress (targetPath )
513
+ if f .upx {
514
+ if tool .SkipUpx {
515
+ log .Printf ("⏭️️ Skipping upx compression" )
516
+ } else {
517
+ f .upxCompress (targetPath )
518
+ }
505
519
}
506
- }
507
520
508
- return true , nil
521
+ return true , nil
522
+ }
509
523
}
510
524
}
511
525
for _ , d := range dirs {
0 commit comments