This repository was archived by the owner on Mar 3, 2023. It is now read-only.
File tree 1 file changed +19
-13
lines changed
1 file changed +19
-13
lines changed Original file line number Diff line number Diff line change @@ -8,24 +8,30 @@ module.exports = function(fn) {
8
8
var to = path . join ( process . cwd ( ) , process . argv [ 3 ] ) ;
9
9
10
10
prompt . start ( ) ;
11
-
12
- prompt . get ( [
13
- {
14
- description : "Enter the config password (" + path . basename ( to ) + "):\n" ,
15
- name : "password" ,
16
- type : "string" ,
17
- hidden : true ,
18
- replace : "*" ,
19
- required : true
20
- }
21
- ] , function ( err , result ) {
11
+
12
+ var schema = {
13
+ description : "Enter the config password (" + path . basename ( to ) + "):\n" ,
14
+ name : "password" ,
15
+ type : "string" ,
16
+ hidden : true ,
17
+ replace : "*" ,
18
+ required : false
19
+ } ;
20
+
21
+ var getSchema = [ ] ;
22
+
23
+ if ( ! process . env . CONFIG_LEAF_PASSWORD ) {
24
+ getSchema . push ( schema ) ;
25
+ }
26
+
27
+ prompt . get ( getSchema , function ( err , result ) {
22
28
if ( err ) {
23
29
console . log ( err ) ;
24
30
} else {
25
31
from = fs . createReadStream ( from ) ;
26
32
to = fs . createWriteStream ( to ) ;
27
- fn = fn ( "cast5-cbc" , result . password ) ;
28
-
33
+ fn = fn ( "cast5-cbc" , result . password || process . env . CONFIG_LEAF_PASSWORD ) ;
34
+
29
35
from . pipe ( fn ) . pipe ( to ) ;
30
36
from . on ( "end" , function ( ) {
31
37
console . log ( "done" ) ;
You can’t perform that action at this time.
0 commit comments