From 9f6845205ff124c3e99ed6f72167c3585e7f22cc Mon Sep 17 00:00:00 2001 From: Joe Hand Date: Sat, 17 Dec 2016 13:33:18 -0800 Subject: use token for sync too --- scripts/sync.js | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 scripts/sync.js (limited to 'scripts') diff --git a/scripts/sync.js b/scripts/sync.js deleted file mode 100644 index 73e86b7..0000000 --- a/scripts/sync.js +++ /dev/null @@ -1,35 +0,0 @@ -var path = require('path') -var ghAuth = require('ghauth') -var ecosystem = require('ecosystem-docs') -var split = require('split2') - -var modules = [] - -process.stdin.pipe(split()).on('data', function (data) { - modules.push(data) -}).on('end', function () { - syncModules(modules, function () { - process.exit(0) - }) -}) - -function syncModules (modules, cb) { - console.log('syncing', modules) - if (process.env.GH_TOKEN) return sync(process.env.GH_TOKEN) - - ghAuth({ - configName: 'ecosystem-docs', - userAgent: 'ecosystem-docs', - scopes: ['user'] - }, (err, auth) => { - if (err) return cb(err) - sync(auth.token) - }) - - function sync (token) { - ecosystem.sync(modules, { - data: path.join(__dirname, '..', '.data'), - token: token - }, cb) - } -} \ No newline at end of file -- cgit v1.2.3