From 3941dec87581e4820009154d1298b44530791806 Mon Sep 17 00:00:00 2001 From: Dennis Brown Date: Mon, 5 Jun 2017 23:10:30 -0500 Subject: [PATCH] made sure docs were only created when they didn't exist, as well as making sure documents were not created when using commands to keep the speed high --- bin/learnyounode | 5 ++++- lib/docbuild.js | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/bin/learnyounode b/bin/learnyounode index 4189ad85..3e606439 100755 --- a/bin/learnyounode +++ b/bin/learnyounode @@ -1,4 +1,7 @@ #!/usr/bin/env node require('../learnyounode').execute(process.argv.slice(2)) -require('../lib/docbuild') + +if(process.argv.slice(2) == 0){ + require('../lib/docbuild') +} diff --git a/lib/docbuild.js b/lib/docbuild.js index a5d8bf86..e2e96618 100644 --- a/lib/docbuild.js +++ b/lib/docbuild.js @@ -1,7 +1,10 @@ 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' -createDocs() +fs.stat('../node-apidoc', function (err) { + if (err) { createDocs() } +})