forked from arp242/goatcounter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgen.go
44 lines (38 loc) · 1019 Bytes
/
gen.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Copyright © 2019 Martin Tournoij <[email protected]>
// This file is part of GoatCounter and published under the terms of the EUPL
// v1.2, which can be found in the LICENSE file or at http://eupl12.zgo.at
// +build go_run_only
package main
import (
"fmt"
"os"
"zgo.at/zpack"
)
func main() {
err := zpack.Pack(map[string]map[string]string{
"./pack/pack.go": {
"Public": "./public",
"Templates": "./tpl",
"SchemaSQLite": "./db/schema.sql",
"SchemaPgSQL": "./db/schema.pgsql",
"MigrationsSQLite": "./db/migrate/sqlite",
"MigrationsPgSQL": "./db/migrate/pgsql",
},
}, "/.keep", "public/fonts/LICENSE")
if err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
// Don't need to commit this.
if _, err := os.Stat("./GeoLite2-Country.mmdb"); err == nil {
err := zpack.Pack(map[string]map[string]string{
"./pack/geodb.go": {
"GeoDB": "./GeoLite2-Country.mmdb",
},
})
if err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
}
}