Exemplo n.º 1
0
func MustExtractDBAsset(defaultDB string) string {
	path, err := cachedir.Get("rtfblog")
	if err != nil {
		panic("Failed to cachedir.Get()")
	}
	dbPath := filepath.Join(path, defaultDB)
	// Extract it only in case there isn't one already from the last time
	if !fileExistsNoErr(dbPath) {
		err = rtfblog_resources.RestoreAsset(path, defaultDB)
		if err != nil {
			panic(fmt.Sprintf("Failed to RestoreAsset(%q, %q)", path, defaultDB))
		}
	}
	return dbPath
}
Exemplo n.º 2
0
func init() {
	cachedir.Get("") // no-op to fix unused import
}