Add Windows build support and fix Windows compatibility issues- Add build-windows.ps1 PowerShell script for Windows builds- Add BUILD-WINDOWS.md documentation for Windows users - Update build.sh to include Windows AMD64 and .exe extensions- Fix util/util.go Windows path handling (use filepath instead of path)- Fix error logging format (%v instead of %w)- Support Windows AMD64, 386, and ARM64 architectures

This commit is contained in:
Othman Suseno
2025-09-16 01:15:52 +07:00
parent 0dedb1a7d9
commit 460934af65
6 changed files with 132 additions and 26 deletions

View File

@@ -5,7 +5,7 @@ import (
"io/ioutil"
"log"
"os"
"path"
"path/filepath"
"strconv"
"strings"
"time"
@@ -42,7 +42,7 @@ func ConnectStorm(dbFilePath string) *storm.DB {
}
}
CreateDirIfNotExist(path.Dir(dbPath))
CreateDirIfNotExist(filepath.Dir(dbPath))
db, openErr := storm.Open(dbPath)
FatalIfError(openErr, "Could not connect Embedded Database File")
@@ -75,7 +75,7 @@ func UnixToTime(timestamp string) time.Time {
func LogIfError(err error, msgOrPattern string, args ...interface{}) bool {
if err != nil {
message := fmt.Sprintf(msgOrPattern, args...)
log.Printf("%s: %w\n", message, err)
log.Printf("%s: %v\n", message, err)
return true
}