Skip to content

Commit

Permalink
kill binaries before build
Browse files Browse the repository at this point in the history
  • Loading branch information
skiffer-git committed May 7, 2024
1 parent 38f9326 commit 86f0883
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
16 changes: 1 addition & 15 deletions magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,12 @@ package main
import (
"github.com/openimsdk/gomake/mageutil"
"os"
"strings"
)

var Default = Build

func Build() {
if _, err := os.Stat("start-config.yml"); err == nil {
InitForSSC()
KillExistBinaries()
}
platforms := os.Getenv("PLATFORMS")
if platforms == "" {
platforms = mageutil.DetectPlatform()
}

for _, platform := range strings.Split(platforms, " ") {
mageutil.CompileForPlatform(platform)
}

mageutil.PrintGreen("All binaries under cmd and tools were successfully compiled.")
mageutil.Build()
}

func Start() {
Expand Down
15 changes: 15 additions & 0 deletions mageutil/bssc.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,3 +204,18 @@ func compileDir(sourceDir, outputBase, platform string) []string {
}
return compiledDirs
}

func Build() {
if _, err := os.Stat("start-config.yml"); err == nil {
InitForSSC()
KillExistBinaries()
}
platforms := os.Getenv("PLATFORMS")
if platforms == "" {
platforms = DetectPlatform()
}
for _, platform := range strings.Split(platforms, " ") {
CompileForPlatform(platform)
}
PrintGreen("All binaries under cmd and tools were successfully compiled.")
}

0 comments on commit 86f0883

Please sign in to comment.