assume-aws-role
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -13,3 +13,16 @@ #!/usr/bin/env node | ||
var filename = path.join(home, ".assume-aws-role", "config"); | ||
var readConfig = function(filename) { | ||
var config = {}; | ||
try { | ||
config = fs.readJsonSync(filename, {throws: false}); | ||
} catch (read_error) { | ||
if (read_error.code != 'ENOENT') { | ||
throw read_error; | ||
} | ||
} | ||
return config; | ||
}; | ||
if (!command) { | ||
@@ -41,3 +54,3 @@ console.error("Usage: assume-aws-role add <alias> <role-arn> [mfa-arn]"); | ||
var config = fs.readJsonSync(filename, {throws: false}) || {}; | ||
var config = readConfig(filename); | ||
@@ -55,3 +68,3 @@ config[alias] = { | ||
var config = fs.readJsonSync(filename, {throws: false}) || {}; | ||
var config = readConfig(filename); | ||
if (!config[command]) { | ||
@@ -58,0 +71,0 @@ console.error("%s not found.", command); |
{ | ||
"name": "assume-aws-role", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Work with multiple AWS accounts more easily", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/jbuck/assume-aws-role", |
@@ -33,2 +33,9 @@ # assume-aws-role | ||
You can also add roles without MFA devices: | ||
``` | ||
assume-aws-role add sandbox \ | ||
"arn:aws:iam::123456789012:role/Administrator" | ||
``` | ||
## How does it work? | ||
@@ -35,0 +42,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5258
100
47