aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe Hand <joe@joeahand.com>2016-12-17 13:33:18 -0800
committerJoe Hand <joe@joeahand.com>2016-12-17 13:33:18 -0800
commit9f6845205ff124c3e99ed6f72167c3585e7f22cc (patch)
tree2e4989f988117d55864a6aeb1066bf5f6e238d5f
parent442498a703819b87940b66cf019098b65b6d86e2 (diff)
downloaddat-docs-9f6845205ff124c3e99ed6f72167c3585e7f22cc.tar.gz
dat-docs-9f6845205ff124c3e99ed6f72167c3585e7f22cc.zip
use token for sync too
-rw-r--r--package.json4
-rw-r--r--scripts/sync.js35
2 files changed, 1 insertions, 38 deletions
diff --git a/package.json b/package.json
index 05dd61e..b588d3f 100644
--- a/package.json
+++ b/package.json
@@ -4,9 +4,7 @@
"description": "Documentation for Dat and the surrounding ecosystem.",
"main": "index.js",
"scripts": {
- "travis:update": "npm run travis:list && npm run travis:sync",
- "travis:list": "npm run update:list && cat repos.txt | node scripts/sync.js",
- "travis:sync": "cat repos.txt | ecosystem-docs read -d ./.data -t ${GH_TOKEN} | node scripts/build.js",
+ "travis:update": "npm run update:list && cat repos.txt | ecosystem-docs sync -t ${GH_TOKEN} && cat repos.txt | ecosystem-docs read -t ${GH_TOKEN} | node scripts/build.js",
"update": "npm run update:list && npm run update:build",
"update:list": "curl -Ssl https://raw.githubusercontent.com/clkao/awesome-dat/master/readme.md | grep '📔' | egrep -o 'github.com/[a-zA-Z0-9_-]+/[a-zA-Z0-9_-]+' | cut -f 2- -d / | uniq > repos.txt",
"update:build": "cat repos.txt | ecosystem-docs sync && cat repos.txt | ecosystem-docs read | node scripts/build.js",
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