All checks were successful
Publish / Test, build, and push image (push) Successful in 3m38s
23 lines
384 B
Go
23 lines
384 B
Go
package app
|
|
|
|
import (
|
|
"os"
|
|
"path/filepath"
|
|
"runtime"
|
|
)
|
|
|
|
func projectRoot() string {
|
|
_, file, _, ok := runtime.Caller(0)
|
|
if !ok {
|
|
return "."
|
|
}
|
|
return filepath.Clean(filepath.Join(filepath.Dir(file), "..", ".."))
|
|
}
|
|
|
|
func assetRoot() string {
|
|
if _, err := os.Stat(filepath.Join("web", "templates")); err == nil {
|
|
return "web"
|
|
}
|
|
return filepath.Join(projectRoot(), "web")
|
|
}
|