File tree Expand file tree Collapse file tree 1 file changed +11
-13
lines changed Expand file tree Collapse file tree 1 file changed +11
-13
lines changed Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
3
- const fs = require ( 'fs' ) ;
4
- const path = require ( 'path' ) ;
5
-
6
- const SECRETS_DIR = '/run/secrets' ;
7
- const output = { } ;
3
+ const fs = require ( 'fs' ) ,
4
+ path = require ( 'path' ) ,
5
+ SECRETS_DIR = '/run/secrets' ,
6
+ output = { } ;
8
7
9
8
if ( fs . existsSync ( SECRETS_DIR ) ) {
10
- const files = fs . readdirSync ( SECRETS_DIR ) ;
11
-
12
- files . forEach ( function ( file , index ) {
13
- const fullPath = path . join ( SECRETS_DIR , file ) ;
14
- const key = file ;
15
- const data = fs . readFileSync ( fullPath , 'utf8' ) . toString ( ) . trim ( ) ;
9
+ const files = fs . readdirSync ( SECRETS_DIR ) ;
16
10
17
- output [ key ] = data ;
18
- } ) ;
11
+ files . forEach ( ( file ) => {
12
+ const fullPath = path . join ( SECRETS_DIR , file ) ,
13
+ key = file ,
14
+ data = fs . readFileSync ( fullPath , 'utf8' ) . toString ( ) . trim ( ) ;
15
+ output [ key ] = data ;
16
+ } ) ;
19
17
}
20
18
21
19
module . exports = output ;
You can’t perform that action at this time.
0 commit comments