File tree 2 files changed +17
-13
lines changed
2 files changed +17
-13
lines changed Original file line number Diff line number Diff line change @@ -59,20 +59,24 @@ io.on('connection', async function (socket) {
59
59
60
60
// Get file list for directory
61
61
async function getFiles ( directory ) {
62
- let items = await fsw . readdir ( directory ) ;
63
- if ( items . length > 0 ) {
64
- let dirs = [ ] ;
65
- let files = [ ] ;
66
- for await ( let item of items ) {
67
- let fullPath = directory + '/' + item ;
68
- if ( fs . lstatSync ( fullPath ) . isDirectory ( ) ) {
69
- dirs . push ( item ) ;
70
- } else {
71
- files . push ( item ) ;
62
+ try {
63
+ let items = await fsw . readdir ( directory ) ;
64
+ if ( items . length > 0 ) {
65
+ let dirs = [ ] ;
66
+ let files = [ ] ;
67
+ for await ( let item of items ) {
68
+ let fullPath = directory + '/' + item ;
69
+ if ( fs . lstatSync ( fullPath ) . isDirectory ( ) ) {
70
+ dirs . push ( item ) ;
71
+ } else {
72
+ files . push ( item ) ;
73
+ }
72
74
}
75
+ send ( 'renderfiles' , [ dirs , files , directory ] ) ;
76
+ } else {
77
+ send ( 'renderfiles' , [ [ ] , [ ] , directory ] ) ;
73
78
}
74
- send ( 'renderfiles' , [ dirs , files , directory ] ) ;
75
- } else {
79
+ } catch ( error ) {
76
80
send ( 'renderfiles' , [ [ ] , [ ] , directory ] ) ;
77
81
}
78
82
}
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " kclient" ,
3
- "version" : " 0.3.3 " ,
3
+ "version" : " 0.3.4 " ,
4
4
"description" : " Kclient is a wrapper for KasmVNC to add functionality to a containerized environment" ,
5
5
"main" : " index.js" ,
6
6
"dependencies" : {
You can’t perform that action at this time.
0 commit comments