Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Apps/node_runner/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ LDFLAGS=-X main.version=$(VERSION)

windows:
x86_64-w64-mingw32-windres -o resource.syso resource.rc
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o '$(BUILD_DIR)/$(APPNAME).exe' main.go
CGO_ENABLED=0 GOOS=windows GOARCH=arm64 go build -ldflags "$(LDFLAGS)" -o '$(BUILD_DIR)/$(APPNAME)_arm64.exe' main.go
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o '$(BUILD_DIR)/$(APPNAME).exe' main.go update.go
CGO_ENABLED=0 GOOS=windows GOARCH=arm64 go build -ldflags "$(LDFLAGS)" -o '$(BUILD_DIR)/$(APPNAME)_arm64.exe' main.go update.go
rm -f resource.syso

mac:
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags "$(LDFLAGS)" -o '$(BUILD_DIR)/$(APPNAME)_macos' main.go
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o '$(BUILD_DIR)/$(APPNAME)_macos_amd64' main.go
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags "$(LDFLAGS)" -o '$(BUILD_DIR)/$(APPNAME)_macos' main.go update.go
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o '$(BUILD_DIR)/$(APPNAME)_macos_amd64' main.go update.go

linux:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o '$(BUILD_DIR)/$(APPNAME)_linux' main.go
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags "$(LDFLAGS)" -o '$(BUILD_DIR)/$(APPNAME)_linux_arm64' main.go
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o '$(BUILD_DIR)/$(APPNAME)_linux' main.go update.go
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags "$(LDFLAGS)" -o '$(BUILD_DIR)/$(APPNAME)_linux_arm64' main.go update.go

checksums:
cd $(BUILD_DIR) && sha256sum * > checksums.txt
Expand Down
26 changes: 25 additions & 1 deletion Apps/node_runner/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,27 @@ func downloadFile(url, destPath string) error {
}
}

// Move the temp file to the destination
// Move the temp file to the destination (on Windows, rename can't cross drives)
if err := os.Rename(out.Name(), destPath); err != nil {
if runtime.GOOS == "windows" {
// Cross-device rename failed, use copy instead
src, err := os.Open(out.Name())
if err != nil {
return fmt.Errorf("failed to open temp file: %v", err)
}
defer src.Close()

dst, err := os.Create(destPath)
if err != nil {
return fmt.Errorf("failed to create destination: %v", err)
}
defer dst.Close()

if _, err := io.Copy(dst, src); err != nil {
return fmt.Errorf("failed to copy file: %v", err)
}
return nil
}
return fmt.Errorf("failed to move file to destination: %v", err)
}

Expand Down Expand Up @@ -274,6 +293,11 @@ func main() {

fmt.Printf("✅ ZeuZ Node %s\n", version)

// Check for updates (non-blocking, uses cached info from last run)
if !HandleUpdateFlow() {
return
}

zeuzDir := getZeuZNodeDir()

if *cleanFlag {
Expand Down
Loading
Loading