Comparing version 0.11.1 to 0.12.0
44
cli.js
@@ -55,19 +55,27 @@ #!/usr/bin/env node | ||
var client; | ||
fs.readFile(args.config, {encoding: 'utf8'}, function(err, contents) { | ||
if (err) { | ||
console.error("This utility needs a config file formatted the same as for s3cmd"); | ||
process.exit(1); | ||
return; | ||
} | ||
var config = ini.parse(contents); | ||
var accessKeyId, secretAccessKey; | ||
if (config && config.default) { | ||
accessKeyId = config.default.access_key; | ||
secretAccessKey = config.default.secret_key; | ||
} | ||
if (!secretAccessKey || !accessKeyId) { | ||
console.error("Config file missing access_key or secret_key"); | ||
process.exit(1); | ||
return; | ||
} | ||
if (process.env.AWS_SECRET_KEY && process.env.AWS_ACCESS_KEY) { | ||
setup(process.env.AWS_SECRET_KEY, process.env.AWS_ACCESS_KEY); | ||
} else { | ||
fs.readFile(args.config, {encoding: 'utf8'}, function(err, contents) { | ||
if (err) { | ||
console.error("This utility needs a config file formatted the same as for s3cmd"); | ||
process.exit(1); | ||
return; | ||
} | ||
var config = ini.parse(contents); | ||
var accessKeyId, secretAccessKey; | ||
if (config && config.default) { | ||
accessKeyId = config.default.access_key; | ||
secretAccessKey = config.default.secret_key; | ||
} | ||
if (!secretAccessKey || !accessKeyId) { | ||
console.error("Config file missing access_key or secret_key"); | ||
process.exit(1); | ||
return; | ||
} | ||
setup(secretAccessKey, accessKeyId); | ||
}); | ||
} | ||
function setup(secretAccessKey, accessKeyId) { | ||
var maxSockets = parseInt(args['max-sockets'], 10); | ||
@@ -88,3 +96,3 @@ http.globalAgent.maxSockets = maxSockets; | ||
fn(); | ||
}); | ||
} | ||
@@ -91,0 +99,0 @@ function cmdSync() { |
{ | ||
"name": "s3-cli", | ||
"version": "0.11.1", | ||
"version": "0.12.0", | ||
"description": "command line utility to go along with s3 module", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -21,2 +21,13 @@ # s3 cli | ||
## Configuration | ||
s3-cli is compatible with s3cmd's config file, so if you already have that | ||
configured, you're all set. Otherwise you can put this in `~/.s3cfg`: | ||
```ini | ||
[default] | ||
access_key = foo | ||
secret_key = bar | ||
``` | ||
## Documentation | ||
@@ -23,0 +34,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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances 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
16156
442
124
5