Skip to content

Commit

Permalink
Allow agent config to use environment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
tmas authored Nov 9, 2020
1 parent 6e36287 commit a1ecb6a
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion modules/ftp-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,23 @@ module.exports = {
protocol: config.protocol || "ftp",
privateKeyPath: config.privateKeyPath,
passphrase: config.passphrase,
agent: config.agent,
agent: this.resolveConfigValue(config.agent),
generatedFiles: config.generatedFiles,
debug: config.debug,
rootPath: this.rootPath
};
},
resolveConfigValue: function(value) {
if (typeof value !== 'string') {
return value;
}
if (value.charAt(0) === '$') {
// resolve as an environment variable
let envVar = value.substr(1);
return process.env[envVar];
}
return value;
},
connectionChanged: function(oldConfig) {
var config = this.getSyncConfig();
return (
Expand Down

0 comments on commit a1ecb6a

Please sign in to comment.