mirror of https://github.com/subgraph/fw-daemon
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
562 B
24 lines
562 B
7 years ago
|
package definitions
|
||
|
|
||
|
import (
|
||
|
"encoding/hex"
|
||
|
"io/ioutil"
|
||
|
"path"
|
||
|
)
|
||
|
|
||
|
func fileContent() []byte {
|
||
|
decoded, _ := hex.DecodeString(schemaDefinition)
|
||
|
return decoded
|
||
|
}
|
||
|
|
||
|
func writeSchemaToDir(dir string) {
|
||
|
ioutil.WriteFile(path.Join(dir, "gschemas.compiled"), fileContent(), 0664)
|
||
|
}
|
||
|
|
||
|
// SchemaInTempDir will create a new temporary directory and put the gsettings schema file in there. It is the callers responsibility to remove the directory
|
||
|
func SchemaInTempDir() string {
|
||
|
dir, _ := ioutil.TempDir("", "fw-settings-gschema")
|
||
|
writeSchemaToDir(dir)
|
||
|
return dir
|
||
|
}
|