Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
489 additions
and
265 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
#! /usr/bin/env node | ||
var _ = require('lodash'); | ||
var _ = require("lodash"); | ||
|
||
var parseArgs = require('minimist')(process.argv.slice(2)) | ||
var parseArgs = require("minimist")(process.argv.slice(2)); | ||
var args = parseArgs._; | ||
var opts = _.clone(parseArgs); | ||
delete opts['_']; | ||
delete opts["_"]; | ||
|
||
require('./api').api(args, opts); | ||
require("./api").api(args, opts); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,35 @@ | ||
var request = require('request'); | ||
var jsonfile = require('jsonfile'); | ||
var request = require("request"); | ||
var jsonfile = require("jsonfile"); | ||
|
||
exports.swagger = true; | ||
exports.login = true; | ||
exports.desc = "Add a user"; | ||
|
||
exports.run = function(config, info) { | ||
var email = info.args[1]; | ||
console.log("Granting " + email.yellow + " push access to " + info.swagger['x-api-id'].yellow + "!"); | ||
console.log( | ||
"Granting " + | ||
email.yellow + | ||
" push access to " + | ||
info.swagger["x-api-id"].yellow + | ||
"!" | ||
); | ||
console.log(""); | ||
|
||
var user = jsonfile.readFileSync(config.apiFile); | ||
|
||
request.post(config.host.url + '/add', { | ||
'form': { | ||
'user': user.token, | ||
'email': email, | ||
'repo': info.swagger['x-api-id'], | ||
request.post( | ||
config.host.url + "/add", | ||
{ | ||
form: { | ||
user: user.token, | ||
email: email, | ||
repo: info.swagger["x-api-id"] | ||
} | ||
}, | ||
function() { | ||
console.log("Success! ".green + "User has been added."); | ||
process.exit(); | ||
} | ||
}, function() { | ||
console.log("Success! ".green + "User has been added."); | ||
process.exit(); | ||
}); | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.