chore: allow to modify app name and assets dir name (#144)

This commit is contained in:
mzz 2023-06-15 23:39:57 +08:00 committed by GitHub
parent 962018d14b
commit b36b56ce6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 2 deletions

View File

@ -8,6 +8,7 @@ package assets
import ( import (
"errors" "errors"
"fmt" "fmt"
"github.com/daeuniverse/dae/common/consts"
"io/fs" "io/fs"
"os" "os"
"path/filepath" "path/filepath"
@ -69,7 +70,7 @@ func (c *LocationFinder) GetLocationAsset(log *logrus.Logger, filename string) (
// Search dirs. // Search dirs.
var searchDirs []string var searchDirs []string
folder := "dae" folder := consts.AppName
// check if DAE_LOCATION_ASSET is set // check if DAE_LOCATION_ASSET is set
location := os.Getenv("DAE_LOCATION_ASSET") location := os.Getenv("DAE_LOCATION_ASSET")
if location != "" { if location != "" {

5
common/consts/app.go Normal file
View File

@ -0,0 +1,5 @@
package consts
var (
AppName = "dae"
)

View File

@ -13,7 +13,6 @@ import (
) )
const ( const (
AppName = "dae"
BpfPinRoot = "/sys/fs/bpf" BpfPinRoot = "/sys/fs/bpf"
TaskCommLen = 16 TaskCommLen = 16