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 (
"errors"
"fmt"
"github.com/daeuniverse/dae/common/consts"
"io/fs"
"os"
"path/filepath"
@ -69,7 +70,7 @@ func (c *LocationFinder) GetLocationAsset(log *logrus.Logger, filename string) (
// Search dirs.
var searchDirs []string
folder := "dae"
folder := consts.AppName
// check if DAE_LOCATION_ASSET is set
location := os.Getenv("DAE_LOCATION_ASSET")
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 (
AppName = "dae"
BpfPinRoot = "/sys/fs/bpf"
TaskCommLen = 16