File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -209,19 +209,20 @@ for item in contents:
209
209
print(item, result[0], result[6], result[9])
210
210
` ;
211
211
const result = await this . _repl . runCode ( code ) ;
212
-
213
212
let contents = [ ] ;
214
213
if ( ! result ) {
215
214
return contents ;
216
215
}
217
216
for ( let line of result . split ( "\n" ) ) {
218
- let [ name , isDir , fileSize , fileDate ] = line . split ( " " ) ;
219
- contents . push ( {
220
- path : name ,
221
- isDir : isDir == TYPE_DIR ,
222
- fileSize : parseInt ( fileSize ) ,
223
- fileDate : parseInt ( fileDate ) * 1000 ,
224
- } ) ;
217
+ if ( line . length > 0 ) {
218
+ let [ name , isDir , fileSize , fileDate ] = line . split ( " " ) ;
219
+ contents . push ( {
220
+ path : name ,
221
+ isDir : isDir == TYPE_DIR ,
222
+ fileSize : parseInt ( fileSize ) ,
223
+ fileDate : parseInt ( fileDate ) * 1000 ,
224
+ } ) ;
225
+ }
225
226
}
226
227
return contents ;
227
228
}
You can’t perform that action at this time.
0 commit comments