Skip to content

Commit bfbf21b

Browse files
committed
fix: default to env ROOT_FOLDER_HOST
1 parent 26a597c commit bfbf21b

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

cmd/runtipi/main.go

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,15 @@ var (
1919

2020
func init() {
2121
var err error
22-
config.RootFolder, err = os.Getwd()
23-
if err != nil {
24-
fmt.Println("Error getting working directory:", err)
25-
os.Exit(1)
22+
23+
config.RootFolder = os.Getenv("ROOT_FOLDER_HOST")
24+
25+
if config.RootFolder == "" {
26+
config.RootFolder, err = os.Getwd()
27+
if err != nil {
28+
fmt.Println("Error getting working directory:", err)
29+
os.Exit(1)
30+
}
2631
}
2732

2833
if envRootFolder := os.Getenv("ROOT_FOLDER_HOST"); envRootFolder != "" {

internal/config/config.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Package config provides application configuration details.
12
package config
23

34
type AppInfo struct {

0 commit comments

Comments
 (0)