File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -186,10 +186,13 @@ async fn main() -> miette::Result<()> {
186
186
187
187
if options. file . is_some ( ) || options. command . is_some ( ) {
188
188
let script_text;
189
+ let filename: Option < String > ;
189
190
if options. file . is_some ( ) {
190
- script_text = std:: fs:: read_to_string ( options. file . unwrap ( ) ) . unwrap ( ) ;
191
+ script_text = std:: fs:: read_to_string ( options. file . clone ( ) . unwrap ( ) ) . unwrap ( ) ;
192
+ filename = Some ( options. file . unwrap ( ) . display ( ) . to_string ( ) ) ;
191
193
} else if options. command . is_some ( ) {
192
194
script_text = options. command . unwrap ( ) ;
195
+ filename = None ;
193
196
} else {
194
197
panic ! ( ) ;
195
198
}
@@ -198,7 +201,7 @@ async fn main() -> miette::Result<()> {
198
201
debug_parse ( & script_text) ;
199
202
return Ok ( ( ) ) ;
200
203
}
201
- let exit_code = execute ( & script_text, Some ( file . display ( ) . to_string ( ) ) , & mut state) . await ?;
204
+ let exit_code = execute ( & script_text, filename , & mut state) . await ?;
202
205
if options. interact {
203
206
interactive ( Some ( state) , options. norc ) . await ?;
204
207
}
You can’t perform that action at this time.
0 commit comments