From c7668514c4279294b4f12f1702228f0a90796dc5 Mon Sep 17 00:00:00 2001 From: Dennis Brown Date: Sat, 10 Mar 2018 22:16:52 -0600 Subject: [PATCH] reduce amount of noise, and add postinstall script to create docs --- bin/learnyounode | 4 ++++ lib/docbuild.js | 8 ++++++-- package.json | 7 +++---- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/bin/learnyounode b/bin/learnyounode index d97c160f..3e606439 100755 --- a/bin/learnyounode +++ b/bin/learnyounode @@ -1,3 +1,7 @@ #!/usr/bin/env node require('../learnyounode').execute(process.argv.slice(2)) + +if(process.argv.slice(2) == 0){ + require('../lib/docbuild') +} diff --git a/lib/docbuild.js b/lib/docbuild.js index 51dad9a9..e2e96618 100644 --- a/lib/docbuild.js +++ b/lib/docbuild.js @@ -1,6 +1,10 @@ -var createDocs = require('node-offline-api') +var createDocs = require('node-offline-api').createDocs +var buildOptions = require('node-offline-api').buildOptions var fs = require('fs') +buildOptions.buildDir = process.cwd() +buildOptions.buildName = 'node_apidoc' + fs.stat('../node-apidoc', function (err) { - if (err.code === 'ENOENT') { createDocs(process.cwd(), 'node_apidoc') } + if (err) { createDocs() } }) diff --git a/package.json b/package.json index 736d07e0..b43ccf3e 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "concat-stream": "^1.5.1", "duplexer": "^0.1.1", "hyperquest": "^2.0.0", - "node-offline-api": "0.12.0", + "node-offline-api": "0.11.0", "rimraf": "^2.5.4", "through": "^2.3.8", "through2": "^2.0.1", @@ -81,10 +81,9 @@ "workshopper-adventure-test": "^1.1.2" }, "scripts": { - "lint": "./node_modules/.bin/standard", + "lint": "./node_modules/.bin/standard --fix", "test": "npm run lint && ./node_modules/.bin/workshopper-adventure-test", - "release": "./node_modules/.bin/standard-version", - "postinstall": "node ./lib/docbuild.js" + "release": "./node_modules/.bin/standard-version" }, "bin": { "learnyounode": "./bin/learnyounode"