@@ -11,7 +11,7 @@ const certbot = {
11
11
/**
12
12
* @param {array } pluginKeys
13
13
*/
14
- installPlugins : async function ( pluginKeys ) {
14
+ installPlugins : async ( pluginKeys ) => {
15
15
let hasErrors = false ;
16
16
17
17
return new Promise ( ( resolve , reject ) => {
@@ -21,7 +21,7 @@ const certbot = {
21
21
}
22
22
23
23
batchflow ( pluginKeys ) . sequential ( )
24
- . each ( ( i , pluginKey , next ) => {
24
+ . each ( ( _i , pluginKey , next ) => {
25
25
certbot . installPlugin ( pluginKey )
26
26
. then ( ( ) => {
27
27
next ( ) ;
@@ -51,7 +51,7 @@ const certbot = {
51
51
* @param {string } pluginKey
52
52
* @returns {Object }
53
53
*/
54
- installPlugin : async function ( pluginKey ) {
54
+ installPlugin : async ( pluginKey ) => {
55
55
if ( typeof dnsPlugins [ pluginKey ] === 'undefined' ) {
56
56
// throw Error(`Certbot plugin ${pluginKey} not found`);
57
57
throw new error . ItemNotFoundError ( pluginKey ) ;
@@ -63,8 +63,14 @@ const certbot = {
63
63
plugin . version = plugin . version . replace ( / { { certbot-v e r s i o n } } / g, CERTBOT_VERSION_REPLACEMENT ) ;
64
64
plugin . dependencies = plugin . dependencies . replace ( / { { certbot-v e r s i o n } } / g, CERTBOT_VERSION_REPLACEMENT ) ;
65
65
66
- const cmd = '. /opt/certbot/bin/activate && pip install --no-cache-dir ' + plugin . dependencies + ' ' + plugin . package_name + plugin . version + ' ' + ' && deactivate' ;
67
- return utils . exec ( cmd )
66
+ const opts = { } ;
67
+ if ( typeof plugin . env === 'object' ) {
68
+ // include process.env in opts
69
+ opts . env = Object . assign ( { } , process . env , plugin . env ) ;
70
+ }
71
+
72
+ const cmd = `. /opt/certbot/bin/activate && pip install --no-cache-dir ${ plugin . dependencies } ${ plugin . package_name } ${ plugin . version } && deactivate` ;
73
+ return utils . exec ( cmd , opts )
68
74
. then ( ( result ) => {
69
75
logger . complete ( `Installed ${ pluginKey } ` ) ;
70
76
return result ;
0 commit comments