Skip to content

Commit

Permalink
config make to init
Browse files Browse the repository at this point in the history
  • Loading branch information
ogom committed Dec 24, 2012
1 parent e7ed418 commit 9ab872d
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 6 deletions.
11 changes: 10 additions & 1 deletion README.md
@@ -1,7 +1,16 @@
s3cli
=====

s3cli is [S3](http://aws.amazon.com/s3/) client and S3 Command Line Interface.
```
. .
/ \ | o
|\ /| .--. .--. .-. | .
| | | `--. --: ( | |
\|/ `--' `--' `-' `- -' `-
'
```

s3cli is [S3](http://aws.amazon.com/s3/) client and S3 Command Line Interface.
inspired by Python's [s3cmd](https://github.com/s3tools/s3cmd).


Expand Down
2 changes: 1 addition & 1 deletion bin/s3cli
Expand Up @@ -207,7 +207,7 @@ cli.program
.command('init')
.description('Invoke interactive (re)configuration')
.action(function () {
cli.configure.make(function () {
cli.configure.init(function () {
cli.config = cli.configure.read();
cli.client().service.buckets(function (err, res) {
cli.output(err, res, {message: 'Successful configuration'});
Expand Down
16 changes: 13 additions & 3 deletions lib/configure.js
Expand Up @@ -55,17 +55,27 @@ Configure.prototype.write = function (config) {
};

/**
* config make
* config init
* @param {Function} cb Callback.
*/
Configure.prototype.make = function (cb) {
Configure.prototype.init = function (cb) {
var self = this;
var config = this.read();

config.host_base = config.host_base || 's3.amazonaws.com';
config.send_chunk = config.send_chunk || 4096;

console.log();
var output = "\
. . \n\
/ \\ | o \n\
|\\ /| .--. .--. .-. | . \n\
| | | `--. --: ( | | \n\
\\|/ `--' `--' `-' `- -' `- \n\
' S3 Command Line Interface \n\
http://aws.amazon.com/s3/ \n\
";
console.log(output);

console.log('Hostname for s3 or compatible');
program.prompt('Hostname (' + config.host_base + '): ', function (host_base) {
config.host_base = host_base || config.host_base;
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "s3cli",
"version": "1.0.1",
"version": "1.0.2",
"description": "S3 client and S3 Command Line Interface",
"main": "./index",
"bin": {
Expand Down

0 comments on commit 9ab872d

Please sign in to comment.