-
Notifications
You must be signed in to change notification settings - Fork 43
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
7 changed files
with
54 additions
and
14 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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
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(""); | ||
|
||
var user = jsonfile.readFileSync(config.apiFile); | ||
|
||
console.log(user.token, config.host.url + '/add'); | ||
|
||
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(); | ||
}); | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
var colors = require('colors'); | ||
var utils = require('../utils'); | ||
|
||
exports.swagger = false; | ||
exports.login = false; | ||
exports.category = "utility"; | ||
exports.desc = "Manage users and versions"; | ||
|
||
exports.run = function(config, info) { | ||
console.log("You can modify your settings from here!"); | ||
console.log(""); | ||
console.log("GRANT PUSH ACCESS".cyan); | ||
console.log("Run the following command to add them (must match their GitHub email):"); | ||
console.log(""); | ||
console.log(" $ oai add [email protected]".grey); | ||
console.log(""); | ||
console.log(""); | ||
|
||
process.exit(); | ||
}; | ||
|
This file was deleted.
Oops, something went wrong.
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