Skip to content

High performance, self-hosted, newsletter and mailing list manager with a modern dashboard. Single binary app.

Prioritise --static-dir on init when no assets are embedded.

Kailash Nadhd695bb34cc60
diff --git a/cmd/init.go b/cmd/init.go
index 5dd3811f..aa983e68 100644
--- a/cmd/init.go
+++ b/cmd/init.go
@@ -126,10 +126,6 @@ func initFS(staticDir, i18nDir string) stuffbin.FileSystem {
"config.toml.sample",
"queries.sql",
"schema.sql",
- "static/email-templates",
-
- // Alias /static/public to /public for the HTTP fileserver.
- "static/public:/public",
// The frontend app's static assets are aliased to /frontend
// so that they are accessible at /frontend/js/* etc.
@@ -139,6 +135,11 @@ func initFS(staticDir, i18nDir string) stuffbin.FileSystem {
"i18n:/i18n",
}
+ // If no external static dir is provided, try to load from the working dir.
+ if staticDir == "" {
+ files = append(files, "static/email-templates", "static/public:/public")
+ }
+
fs, err = stuffbin.NewLocalFS("/", files...)
if err != nil {
lo.Fatalf("failed to initialize local file for assets: %v", err)