examples: make examples/templates/templates.v runable from everywhere, not just .

pull/8833/head
Delyan Angelov 2021-02-19 17:29:35 +02:00
parent bcb35e15f9
commit 3a65ccd060
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
1 changed files with 2 additions and 2 deletions

View File

@ -171,11 +171,11 @@ fn data_get() []SiteConfig {
fn data_dump(data []SiteConfig) {
a := json.encode_pretty(data)
os.write_file('data.json', a) or { panic(err) }
os.write_file(os.resource_abs_path('data.json'), a) or { panic(err) }
}
fn data_load() []SiteConfig {
data := os.read_file('data.json') or { panic(err) }
data := os.read_file(os.resource_abs_path('data.json')) or { panic(err) }
a := json.decode([]SiteConfig, data) or { panic(err) }
return a
}