@@ -62,7 +62,7 @@ func runInstall(cmd *cobra.Command, args []string) error { // NOSONAR
6262 tagDisplay = "latest"
6363 }
6464 }
65- styles .PrintKV ("Repository: " , fmt .Sprintf ("%s/%s:%s" , owner , repo , tagDisplay ))
65+ styles .PrintKV ("Repository" , fmt .Sprintf ("%s/%s:%s" , owner , repo , tagDisplay ))
6666
6767 client := getClient ()
6868
@@ -74,7 +74,7 @@ func runInstall(cmd *cobra.Command, args []string) error { // NOSONAR
7474 log .Debugf ("release: %v" , release )
7575 }
7676
77- //styles.PrintKV("Version: ", fmt.Sprintf("%s (%s)", release.GetTagName(), release.GetName()))
77+ //styles.PrintKV("Version", fmt.Sprintf("%s (%s)", release.GetTagName(), release.GetName()))
7878 renderReleaseTable (release )
7979
8080 // Asset
@@ -114,7 +114,7 @@ func runInstall(cmd *cobra.Command, args []string) error { // NOSONAR
114114
115115 log .Infof ("id: %v" , asset .GetID ())
116116 log .Infof ("url: %v" , asset .GetBrowserDownloadURL ())
117- styles .PrintKV ("Asset Name: " , asset .GetName ())
117+ styles .PrintKV ("Asset Name" , asset .GetName ())
118118
119119 rc , _ , err := client .Repositories .DownloadReleaseAsset (
120120 context .Background (), owner , repo , asset .GetID (), http .DefaultClient ,
@@ -223,7 +223,13 @@ func runInstall(cmd *cobra.Command, args []string) error { // NOSONAR
223223
224224 // Move it to binPath
225225 destPath := filepath .Join (binPath , destName )
226- styles .PrintKV ("Destination:" , destPath )
226+ log .Infof ("destPath: %v" , destPath )
227+ destDisplay := destPath
228+ log .Debugf ("DOCKER: %v" , os .Getenv ("DOCKER" ))
229+ if os .Getenv ("DOCKER" ) == "true" {
230+ destDisplay = fmt .Sprintf ("-v <bin>/%s" , binPath )
231+ }
232+ styles .PrintKV ("Destination" , destDisplay )
227233 if err := os .Rename (binaryFilePath , destPath ); err != nil {
228234 log .Infof ("os.Rename failed (copying): %v" , err )
229235 // Read the file content
@@ -245,7 +251,7 @@ func runInstall(cmd *cobra.Command, args []string) error { // NOSONAR
245251 log .Warnf ("Bin directory not in PATH: %v" , binPath )
246252 }
247253
248- styles .PrintKV ("Installed: " , destName )
254+ styles .PrintKV ("Installed" , destName )
249255 return nil
250256}
251257
@@ -430,22 +436,26 @@ func ensureWinExt(destName string) string {
430436}
431437
432438func parseRepository (args []string ) (owner , repo , tag string , err error ) {
433- helpErr := errors .New ("repository must be in format: owner/repo[:tag]" )
434- log .Debugf ("parseRepository: %v" , len (args ))
439+ helpErr := errors .New ("repository format: owner/repo[:tag]" )
440+ log .Debugf ("parseRepository %v : %v" , len (args ), args )
435441 switch len (args ) {
436442 case 0 :
437443 return "" , "" , "" , helpErr
438444 case 1 :
439445 repository := args [0 ]
440- if strings .Contains (repository , ":" ) {
441- split := strings .Split (repository , ":" )
442- repository = split [0 ]
443- tag = split [1 ]
444- } else if strings .Contains (repository , "@" ) {
445- split := strings .Split (repository , "@" )
446- repository = split [0 ]
447- tag = split [1 ]
446+ // Check for :tag @tag /tag
447+ if idx := strings .IndexAny (args [0 ], ":@" ); idx != - 1 {
448+ log .Debugf ("idx: %v" , idx )
449+ repository = args [0 ][:idx ]
450+ tag = args [0 ][idx + 1 :]
451+ } else if strings .Count (args [0 ], "/" ) == 2 {
452+ split := strings .Split (args [0 ], "/" )
453+ if split [2 ] != "" {
454+ repository = split [0 ] + "/" + split [1 ]
455+ tag = split [2 ]
456+ }
448457 }
458+ // Set owner/repo
449459 split := strings .Split (repository , "/" )
450460 if len (split ) != 2 {
451461 return "" , "" , "" , helpErr
0 commit comments