Attempt to create "sites" folder on start (fix #32)

This commit is contained in:
Noah 2024-04-02 21:10:51 -05:00
parent 7ccd29bfb1
commit 401f4a89f8

View File

@ -102,6 +102,11 @@ func main() {
go handler(data) // Run the handler
fmt.Fprint(w, "Received!")
})
// Attempt to create sites_dir
if exists, _ := fileExists(configuration.sites_dir); !exists {
os.Mkdir(configuration.sites_dir, 640) // Permissions are 640 (Owner: rw, Group: r, All: none)
}
log.Printf("Starting Lapis Deploy on port %d...", configuration.port)
startAllSites() // Start all the servers