Skip to content

Commit

Permalink
Support for multiple repository configurations via PWD/.bitbucket/con…
Browse files Browse the repository at this point in the history
…fig.json location usage
  • Loading branch information
Dan Shumaker committed Jun 5, 2017
1 parent 5ca5295 commit 05ec04d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
bin/bitbucket
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,21 @@ Then, in your shell type:
##### First use

$ bitbucket
bitbucket URL: https://bitbucket.org/

It will prompte you for the repositories subdirectory url. It auto-supplies the proper bitbucket api URL prefix

Repository subdir URL: https://api.bitbucket.org/2.0/repositories/

<Type in your repo name here> (for example `phase2tech/bla_dev_vm`) and then hit return a couple times for the username prompt

Username: xxxxxx
Password: xxxxxx

Once you hit enter after the password then you should get this message:

Information stored!

This saves your credentials (base64 encoded) in your `$HOME/.bitbucket` folder.
This saves your credentials (base64 encoded) in the current directory in a subdirectory `.bitbucket` folder. Named config.json
This config behavior was used from the jira-cmd repo listed above.

#### Reviewers
Expand Down Expand Up @@ -154,4 +163,5 @@ Checkout ```~/.bitbucket/config.json``` for more options.

### TODO
* --diff and --decline are not working properly.
* Allow config to handle multiple repos
* Allow config to handle multiple repos - currently this is done by creating a subdirectory in the current directory but ideally I'd like to have
* a -cf cli option for the location of the config.json file.
2 changes: 1 addition & 1 deletion bin/bitbucket.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ requirejs([
], function (program, config, auth, pr) {

program
.version('v0.0.1');
.version('v0.2.1');

program
.command('pr')
Expand Down
1 change: 0 additions & 1 deletion lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ define([
};

function getCfgPath () {
//var systemHomePath = process.env[(process.platform == 'win32') ? 'HOMEPATH' : 'HOME'];
return path.join(process.cwd(), '/.bitbucket/');
}
});

0 comments on commit 05ec04d

Please sign in to comment.