File tree 2 files changed +18
-0
lines changed
2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -141,6 +141,9 @@ func main() {
141
141
fatal (err )
142
142
}
143
143
}
144
+ if err := reviseRootDir (context ); err != nil {
145
+ return err
146
+ }
144
147
return logs .ConfigureLogging (createLogConfig (context ))
145
148
}
146
149
Original file line number Diff line number Diff line change @@ -92,6 +92,21 @@ func revisePidFile(context *cli.Context) error {
92
92
return context .Set ("pid-file" , pidFile )
93
93
}
94
94
95
+ // reviseRootDir convert the root to absolute path
96
+ func reviseRootDir (context * cli.Context ) error {
97
+ root := context .GlobalString ("root" )
98
+ if root == "" {
99
+ return nil
100
+ }
101
+
102
+ root , err := filepath .Abs (root )
103
+ if err != nil {
104
+ return err
105
+ }
106
+
107
+ return context .GlobalSet ("root" , root )
108
+ }
109
+
95
110
// parseBoolOrAuto returns (nil, nil) if s is empty or "auto"
96
111
func parseBoolOrAuto (s string ) (* bool , error ) {
97
112
if s == "" || strings .ToLower (s ) == "auto" {
You can’t perform that action at this time.
0 commit comments