chore: change env names
This commit is contained in:
@@ -11,15 +11,15 @@ type Config struct {
|
||||
}
|
||||
|
||||
func Load() (*Config, error) {
|
||||
dir := os.Getenv("BASE_PATH")
|
||||
db := os.Getenv("DB_LINK")
|
||||
libDir := os.Getenv("LIBRARY_DIR")
|
||||
dataDir := os.Getenv("DATA_DIR")
|
||||
|
||||
if dir == "" || db == "" {
|
||||
return nil, errors.New("must set BASE_PATH and DB_LINK in env")
|
||||
if libDir == "" || dataDir == "" {
|
||||
return nil, errors.New("must set LIBRARY_DIR and DATA_DIR in env")
|
||||
}
|
||||
|
||||
return &Config{
|
||||
BaseDir: dir,
|
||||
DBPath: db,
|
||||
BaseDir: libDir,
|
||||
DBPath: dataDir + "/YaBL.db",
|
||||
}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user