mirror of
https://github.com/sbrow/envr.git
synced 2026-06-28 02:58:33 -04:00
chore: Cleaned up code.
This commit is contained in:
@@ -24,8 +24,10 @@ Config :: struct {
|
||||
}
|
||||
|
||||
default_config_path :: proc(home: string) -> string {
|
||||
// FIXME: catch error
|
||||
path, _ := filepath.join([]string{home, ".envr", "config.json"})
|
||||
path, err := filepath.join([]string{home, ".envr", "config.json"})
|
||||
if err != nil {
|
||||
panic("Ran out of memory when building config path")
|
||||
}
|
||||
return path
|
||||
}
|
||||
|
||||
@@ -37,6 +39,7 @@ load_config :: proc(config_path: string) -> (Config, bool) {
|
||||
}
|
||||
|
||||
cfg: Config
|
||||
// TODO: use json 5
|
||||
err := json.unmarshal(data, &cfg)
|
||||
if err != nil {
|
||||
fmt.printf("Error parsing config: %v\n", err)
|
||||
|
||||
Reference in New Issue
Block a user