mirror of
https://forge.fsky.io/oneflux/omegafox.git
synced 2026-02-10 18:32:06 -08:00
Fix launcher issues on macos #7
Fixes properties.json path not being found.
This commit is contained in:
parent
598a8566e2
commit
662e62fb2c
2 changed files with 11 additions and 3 deletions
|
|
@ -115,7 +115,7 @@ func parseJson(argv string, target interface{}) {
|
|||
if fileExists(argv) {
|
||||
data, err = os.ReadFile(argv)
|
||||
if err != nil {
|
||||
fmt.Printf("Error reading config file: %v\n", err)
|
||||
fmt.Printf("Error reading JSON file: %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
} else {
|
||||
|
|
@ -124,7 +124,7 @@ func parseJson(argv string, target interface{}) {
|
|||
}
|
||||
|
||||
if err := json.Unmarshal(data, target); err != nil {
|
||||
fmt.Printf("Invalid JSON in config: %v\n", err)
|
||||
fmt.Printf("Invalid JSON: %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import (
|
|||
"math"
|
||||
"os"
|
||||
"reflect"
|
||||
"runtime"
|
||||
)
|
||||
|
||||
type Property struct {
|
||||
|
|
@ -36,8 +37,15 @@ func validateConfig(configMap map[string]interface{}) {
|
|||
}
|
||||
|
||||
func loadProperties() []Property {
|
||||
propertiesPath := getPath("properties.json")
|
||||
// Get the path to the properties.json file
|
||||
var propertiesPath string
|
||||
if normalizeOS(runtime.GOOS) == "macos" {
|
||||
propertiesPath = getPath("Camoufox.app/Contents/Resources/properties.json")
|
||||
} else {
|
||||
propertiesPath = getPath("properties.json")
|
||||
}
|
||||
var properties []Property
|
||||
// Parse the JSON file
|
||||
parseJson(propertiesPath, &properties)
|
||||
return properties
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue