@@ -11,7 +11,7 @@ const certbot = {
1111 /**
1212 * @param {array } pluginKeys
1313 */
14- installPlugins : async function ( pluginKeys ) {
14+ installPlugins : async ( pluginKeys ) => {
1515 let hasErrors = false ;
1616
1717 return new Promise ( ( resolve , reject ) => {
@@ -21,7 +21,7 @@ const certbot = {
2121 }
2222
2323 batchflow ( pluginKeys ) . sequential ( )
24- . each ( ( i , pluginKey , next ) => {
24+ . each ( ( _i , pluginKey , next ) => {
2525 certbot . installPlugin ( pluginKey )
2626 . then ( ( ) => {
2727 next ( ) ;
@@ -51,7 +51,7 @@ const certbot = {
5151 * @param {string } pluginKey
5252 * @returns {Object }
5353 */
54- installPlugin : async function ( pluginKey ) {
54+ installPlugin : async ( pluginKey ) => {
5555 if ( typeof dnsPlugins [ pluginKey ] === 'undefined' ) {
5656 // throw Error(`Certbot plugin ${pluginKey} not found`);
5757 throw new error . ItemNotFoundError ( pluginKey ) ;
@@ -63,8 +63,14 @@ const certbot = {
6363 plugin . version = plugin . version . replace ( / { { certbot-v e r s i o n } } / g, CERTBOT_VERSION_REPLACEMENT ) ;
6464 plugin . dependencies = plugin . dependencies . replace ( / { { certbot-v e r s i o n } } / g, CERTBOT_VERSION_REPLACEMENT ) ;
6565
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 )
6874 . then ( ( result ) => {
6975 logger . complete ( `Installed ${ pluginKey } ` ) ;
7076 return result ;
0 commit comments