qa-svelte: initial commit
This commit is contained in:
parent
abdf146fea
commit
0fe037d7f5
43 changed files with 2089 additions and 1297 deletions
32
qa/assets-dev.go
Normal file
32
qa/assets-dev.go
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
//go:build dev
|
||||
// +build dev
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"net/http"
|
||||
"os"
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
var (
|
||||
Assets http.FileSystem
|
||||
StaticDir string = "ui/"
|
||||
)
|
||||
|
||||
func init() {
|
||||
flag.StringVar(&StaticDir, "static", StaticDir, "Directory containing static files")
|
||||
}
|
||||
|
||||
func sanitizeStaticOptions() error {
|
||||
StaticDir, _ = filepath.Abs(StaticDir)
|
||||
if _, err := os.Stat(StaticDir); os.IsNotExist(err) {
|
||||
StaticDir, _ = filepath.Abs(filepath.Join(filepath.Dir(os.Args[0]), "ui"))
|
||||
if _, err := os.Stat(StaticDir); os.IsNotExist(err) {
|
||||
return err
|
||||
}
|
||||
}
|
||||
Assets = http.Dir(StaticDir)
|
||||
return nil
|
||||
}
|
||||
Reference in a new issue