Comparing version 0.1.12 to 0.1.13
@@ -22,5 +22,5 @@ #!/usr/bin/env node | ||
var _cli = require('./cli'); | ||
var _cli2 = require('./cli'); | ||
var _cli2 = _interopRequireDefault(_cli); | ||
var _cli3 = _interopRequireDefault(_cli2); | ||
@@ -38,8 +38,16 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
_commander2.default.version(appPackage.version, '-v, --version').option('-r, --reset', 'reset authentication').parse(process.argv); | ||
_commander2.default.version(appPackage.version, '-v, --version').option('-a, --auth', 'reset authentication').option('-s, --star', 'star this repo') | ||
// .option('-r, --recursive', 'Recursive mode, add stars to all the dependencies.') | ||
.parse(process.argv); | ||
var authPath = appPath + '/auth.json'; | ||
_fs2.default.stat(authPath, function (error, existAuth) { | ||
if (!existAuth || _commander2.default.reset) { | ||
_cli2.default.menu(authPath); | ||
// Do not exist the auth.json file or select reset authentication. | ||
if (!existAuth || _commander2.default.auth) { | ||
_cli3.default.menu(authPath); | ||
} else if (_commander2.default.star) { | ||
var metaData = { dependencies: { 'add-stars': '' } }; | ||
var auth = _jsonfile2.default.readFileSync(authPath); | ||
var cli = new _cli3.default(metaData, auth); | ||
cli.run(); | ||
} else { | ||
@@ -53,6 +61,6 @@ (function () { | ||
} else { | ||
var metaData = require(currentPackage); | ||
var auth = _jsonfile2.default.readFileSync(authPath); | ||
var cli = new _cli2.default(metaData, auth); | ||
cli.run(); | ||
var _metaData = require(currentPackage); | ||
var _auth = _jsonfile2.default.readFileSync(authPath); | ||
var _cli = new _cli3.default(_metaData, _auth); | ||
_cli.run(); | ||
} | ||
@@ -59,0 +67,0 @@ }); |
@@ -19,3 +19,2 @@ import jsonfile from 'jsonfile'; | ||
this.gh = new GH(dependencies, this.auth); | ||
} | ||
@@ -22,0 +21,0 @@ |
@@ -18,3 +18,5 @@ #!/usr/bin/env node | ||
.version(appPackage.version, '-v, --version') | ||
.option('-r, --reset', 'reset authentication') | ||
.option('-a, --auth', 'reset authentication') | ||
.option('-s, --star', 'star this repo') | ||
// .option('-r, --recursive', 'Recursive mode, add stars to all the dependencies.') | ||
.parse(process.argv); | ||
@@ -24,4 +26,10 @@ | ||
fs.stat(authPath, (error, existAuth) => { | ||
if (!existAuth || program.reset) { | ||
// Do not exist the auth.json file or select reset authentication. | ||
if (!existAuth || program.auth) { | ||
Cli.menu(authPath); | ||
} else if (program.star) { | ||
let metaData = { dependencies: { 'add-stars': ''} }; | ||
let auth = jsonfile.readFileSync(authPath); | ||
let cli = new Cli(metaData, auth); | ||
cli.run(); | ||
} else { | ||
@@ -40,4 +48,3 @@ let currentDirectory = process.cwd(); | ||
}); | ||
} | ||
}); |
{ | ||
"name": "add-stars", | ||
"version": "0.1.12", | ||
"version": "0.1.13", | ||
"description": "Add stars to repos used in your project.", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -27,5 +27,10 @@ # add-stars | ||
```bash | ||
$ add-stars -r | ||
$ add-stars -a | ||
``` | ||
#### Star this repo 👍 | ||
```bash | ||
$ add-stars -s | ||
``` | ||
#### Help | ||
@@ -32,0 +37,0 @@ ```bash |
216558
478
43