diff --git a/launcher/main.go b/launcher/main.go index 0851cb6..4a4c76f 100644 --- a/launcher/main.go +++ b/launcher/main.go @@ -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) } } diff --git a/launcher/validate.go b/launcher/validate.go index 9fca2a2..44dc7db 100644 --- a/launcher/validate.go +++ b/launcher/validate.go @@ -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 }