Update Semantic
Fixes #40,#24
This commit is contained in:
parent
1715f27f44
commit
2027b94179
621 changed files with 172488 additions and 15939 deletions
38
web/semantic/tasks/config/admin/github.js
Normal file
38
web/semantic/tasks/config/admin/github.js
Normal file
|
@ -0,0 +1,38 @@
|
|||
/*******************************
|
||||
GitHub Login
|
||||
*******************************/
|
||||
/*
|
||||
Logs into GitHub using OAuth
|
||||
*/
|
||||
|
||||
var
|
||||
fs = require('fs'),
|
||||
path = require('path'),
|
||||
githubAPI = require('github'),
|
||||
|
||||
// stores oauth info for GitHub API
|
||||
oAuthConfig = path.join(__dirname, 'oauth.js'),
|
||||
oAuth = fs.existsSync(oAuthConfig)
|
||||
? require(oAuthConfig)
|
||||
: false,
|
||||
github
|
||||
;
|
||||
|
||||
if(!oAuth) {
|
||||
console.log('here');
|
||||
console.error('Must add oauth token for GitHub in tasks/config/admin/oauth.js');
|
||||
}
|
||||
|
||||
github = new githubAPI({
|
||||
version : '3.0.0',
|
||||
debug : true,
|
||||
protocol : 'https',
|
||||
timeout : 5000
|
||||
});
|
||||
|
||||
github.authenticate({
|
||||
type: 'oauth',
|
||||
token: oAuth.token
|
||||
});
|
||||
|
||||
module.exports = github;
|
Reference in a new issue