Don't print 'user: undefined' for the env profile for 'triton profile' if not defined

This commit is contained in:
Trent Mick 2015-11-05 11:33:59 -08:00
parent dd95ab5f4a
commit 6b1065b24d
2 changed files with 6 additions and 2 deletions

View File

@ -226,7 +226,10 @@ function _loadEnvProfile() {
}; };
envProfile.account = process.env.TRITON_ACCOUNT || process.env.SDC_ACCOUNT; envProfile.account = process.env.TRITON_ACCOUNT || process.env.SDC_ACCOUNT;
envProfile.user = process.env.TRITON_USER || process.env.SDC_USER; var user = process.env.TRITON_USER || process.env.SDC_USER;
if (user) {
envProfile.user = user;
}
envProfile.url = process.env.TRITON_URL || process.env.SDC_URL; envProfile.url = process.env.TRITON_URL || process.env.SDC_URL;
envProfile.keyId = process.env.TRITON_KEY_ID || process.env.SDC_KEY_ID; envProfile.keyId = process.env.TRITON_KEY_ID || process.env.SDC_KEY_ID;
if (process.env.TRITON_TLS_INSECURE) { if (process.env.TRITON_TLS_INSECURE) {

View File

@ -47,6 +47,7 @@ function _showProfile(opts, cb) {
Object.keys(profile).sort().forEach(function (key) { Object.keys(profile).sort().forEach(function (key) {
if (key === 'name') if (key === 'name')
return; return;
if (profile[key] !== undefined)
console.log('%s: %s', key, profile[key]); console.log('%s: %s', key, profile[key]);
}); });
} }