Skip to content

Commit

Permalink
feat: move module binary to KUSION_HOME by new path format
Browse files Browse the repository at this point in the history
  • Loading branch information
SparkYuan committed Apr 22, 2024
1 parent e77a5fd commit 5cf1d5f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/cmd/mod/mod_push.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ func (o *PushModOptions) buildModule() (string, error) {

output := filepath.Join(targetDir, "_dist", pOS, pArch, "kusion-module-"+name+"_"+o.Version)
if strings.Contains(o.OSArch, "windows") {
output = filepath.Join(targetDir, "_dist", pOS, pArch, "kusion-module-"+name+"_"+o.Version+".exe")
output = output + ".exe"

Check failure on line 340 in pkg/cmd/mod/mod_push.go

View workflow job for this annotation

GitHub Actions / Golang Lint

assignOp: replace `output = output + ".exe"` with `output += ".exe"` (gocritic)
}

path, err := buildBinary(goBin, pOS, pArch, moduleSrc, output, o.IOStreams)
Expand Down
4 changes: 2 additions & 2 deletions pkg/engine/api/generate/generator/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ func copyDependentModules(workDir string) error {
if dep.Source.Oci != nil {
info := dep.Source.Oci
pkgDir := filepath.Join(absPkgPath, dep.FullName)
platform := fmt.Sprintf("%s-%s", runtime.GOOS, runtime.GOARCH)
source := filepath.Join(pkgDir, "_dist", platform, "generator")
source := filepath.Join(pkgDir, "_dist", runtime.GOOS, runtime.GOARCH, "kusion-module-"+dep.FullName)

moduleDir := filepath.Join(kusionHomePath, "modules", info.Repo, info.Tag, runtime.GOOS, runtime.GOARCH)
dest := filepath.Join(moduleDir, fmt.Sprintf("kusion-module-%s", dep.FullName))
if runtime.GOOS == "windows" {
Expand Down

0 comments on commit 5cf1d5f

Please sign in to comment.