@@ -14,6 +14,7 @@ import (
14
14
"github.com/spf13/cobra"
15
15
"github.com/tidwall/gjson"
16
16
"os" //nolint
17
+ "path"
17
18
"path/filepath"
18
19
"strings" //nolint
19
20
"sync" //nolint
35
36
36
37
func usageTemplate () string {
37
38
once .Do (func () {
38
- bytes , _ := templates .ReadFile (fmt . Sprintf ( "%s/ usage.tmpl", tmplDir ))
39
+ bytes , _ := templates .ReadFile (path . Join ( tmplDir , " usage.tmpl" ))
39
40
usage = color .YellowString (string (bytes ))
40
41
})
41
42
return usage
@@ -48,7 +49,8 @@ func parseArtifacts(cmd *cobra.Command, args []string, name string) (gjson.Resul
48
49
if test , uqf := utils .TestCaller (); test {
49
50
data , err = os .ReadFile (filepath .Join (artifact .CurProject ().Root (), "target" , uqf , "config.json" ))
50
51
} else {
51
- data , err = resources .ReadFile (fmt .Sprintf ("%s/config.json" , resourceDir ))
52
+ path .Join ()
53
+ data , err = resources .ReadFile (path .Join (resourceDir , "config.json" ))
52
54
}
53
55
if err != nil {
54
56
return result , err
@@ -73,7 +75,7 @@ func installPlugins(cmd *cobra.Command, args []string) error {
73
75
}
74
76
if len (plugin .Config ) > 0 {
75
77
if _ , err = os .Stat (filepath .Join (artifact .CurProject ().Root (), plugin .Config )); err != nil {
76
- if data , err = resources .ReadFile (fmt . Sprintf ( "%s/%s" , resourceDir , plugin .Config )); err == nil {
78
+ if data , err = resources .ReadFile (path . Join ( resourceDir , plugin .Config )); err == nil {
77
79
if err = os .WriteFile (filepath .Join (artifact .CurProject ().Root (), plugin .Config ), data , os .ModePerm ); err != nil {
78
80
break
79
81
}
0 commit comments