diff options
author | xengineering <me@xengineering.eu> | 2023-04-13 20:16:19 +0200 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2023-04-13 20:21:58 +0200 |
commit | d82eae7034e0de30b5d61294cdb78c3ad8c1bbda (patch) | |
tree | f44cb92dd6a797545cf9891af00a86516f596ec6 /main.go | |
parent | 4ed4b195e9e78d22f9eae0925403de645b5bc30a (diff) | |
download | ceres-d82eae7034e0de30b5d61294cdb78c3ad8c1bbda.tar ceres-d82eae7034e0de30b5d61294cdb78c3ad8c1bbda.tar.zst ceres-d82eae7034e0de30b5d61294cdb78c3ad8c1bbda.zip |
Automate /var/lib/ceres creation
That way only the system user setup and ownership change has to be done
by the packager / installer.
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -2,6 +2,8 @@ package main import ( "log" + "os" + "path/filepath" "text/template" ) @@ -11,6 +13,10 @@ var templates *template.Template func main() { log.Printf("Started Ceres recipe server.\n") config = GetRuntimeConfig() + err := os.Mkdir(filepath.Join(config.Data, "recipes"), 0750) + if err != nil && !os.IsExist(err) { + log.Fatal(err) + } templates = setupTemplates() runServer() } |