File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -105,7 +105,11 @@ Options:
105
105
106
106
var assets string
107
107
if s , ok := utils .Argument (d , "--assets-dir" ); ok {
108
- assets = s
108
+ abspath , err := filepath .Abs (s )
109
+ if err != nil {
110
+ log .PanicErrorf (err , "get absolute path of %s failed" , s )
111
+ }
112
+ assets = abspath
109
113
} else {
110
114
binpath , err := filepath .Abs (filepath .Dir (os .Args [0 ]))
111
115
if err != nil {
@@ -115,12 +119,9 @@ Options:
115
119
}
116
120
log .Warnf ("set assets = %s" , assets )
117
121
118
- fi , err := os .Stat (assets )
119
- if err != nil {
120
- log .PanicErrorf (err , "get stat of %s failed" , assets )
121
- }
122
- if ! fi .IsDir () {
123
- log .Panicf ("%s is not a directory" , assets )
122
+ indexFile := filepath .Join (assets , "index.html" )
123
+ if _ , err := os .Stat (indexFile ); err != nil {
124
+ log .PanicErrorf (err , "get stat of %s failed" , indexFile )
124
125
}
125
126
126
127
var loader ConfigLoader
You can’t perform that action at this time.
0 commit comments