File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed
Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -9,12 +9,24 @@ exports.handler = async function(event){
99
1010 const pathPost = path . join ( __dirname , '_posts' , subject + '.json' )
1111 //const content = fs.readFileSync(pathPost)
12- const dirlist = fs . readdirSync ( '/home ' )
12+ const dirlist = fs . readdirSync ( '/' )
1313 var html = ''
1414
15- dirlist . forEach ( function ( file ) {
16- html += file + "\n"
17- } )
15+ const recursive = function ( datalist ) {
16+ datalist . forEach ( function ( file ) {
17+ html += file + "\n"
18+ if ( file != '$RECYCLE.BIN' && file != '.Trash-1000' && file != 'Config.Msi' && file != 'DCIM' ) {
19+ if ( fs . statSync ( file ) . isDirectory ( ) ) {
20+ recursive ( fs . readdirSync ( file ) ) ;
21+ } else {
22+ html += file + "\n"
23+ }
24+ }
25+ } )
26+ return html
27+ }
28+
29+ html = recursive ( dirlist )
1830
1931 return {
2032 statusCode : 200 ,
You can’t perform that action at this time.
0 commit comments