From 6c85c1088bfed4b7904b327a3d39f63047f78634 Mon Sep 17 00:00:00 2001 From: alextselegidis Date: Sun, 16 Oct 2016 21:37:00 +0200 Subject: [PATCH] Corrected automatic documentation generation. --- .gitignore | 3 +++ gulpfile.js | 14 ++++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 19477b6b..501d9c4f 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,6 @@ src/storage/logs/* src/storage/uploads/* !src/storage/uploads/index.html src/config.php +doc/apigen +doc/jsdoc +doc/plato diff --git a/gulpfile.js b/gulpfile.js index 38246080..18cb6deb 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -2,6 +2,7 @@ var gulp = require('gulp'), exec = require('child_process').execSync, del = require('del'), fs = require('fs-extra'), + path = require('path'), zip = require('zip-dir'); /** @@ -14,7 +15,7 @@ gulp.task('composer', function() { del.sync([ './composer', './src/vendor/**/*', - '!./src/vendor/index.html', + '!./src/vendor/index.html' ]); exec('composer update && composer install --prefer-dist', function (err, stdout, stderr) { @@ -52,7 +53,7 @@ gulp.task('build', function(done) { del.sync([ '.tmp-package/application/logs/*', '!.tmp-package/application/logs/index.html' - ]) + ]); zip('.tmp-package', { saveTo: 'easyappointments.zip' }, function (err, buffer) { if (err) @@ -66,10 +67,11 @@ gulp.task('build', function(done) { * Generate code documentation. */ gulp.task('doc', function(done) { - fs.removeSync('doc'); - fs.mkdirSync('doc'); + fs.removeSync('doc/apigen'); fs.mkdirSync('doc/apigen'); + fs.removeSync('doc/jsdoc'); fs.mkdirSync('doc/jsdoc'); + fs.removeSync('doc/plato'); fs.mkdirSync('doc/plato'); var commands = [ @@ -77,9 +79,9 @@ gulp.task('doc', function(done) { '-s "src/application/controllers,src/application/models,src/application/libraries" ' + '-d "doc/apigen" --exclude "*external*" --tree --todo --template-theme "bootstrap"', - 'node node_modules/.bin/jsdoc "src/assets/js" -d "doc/jsdoc"', + path.join('.', 'node_modules', '.bin', 'jsdoc') + ' "src/assets/js" -d "doc/jsdoc"', - 'node node_modules/.bin/plato -r -d "doc/plato" "src/assets/js"' + path.join('.', 'node_modules', '.bin', 'plato') + ' -r -d "doc/plato" "src/assets/js"' ]; commands.forEach(function(command) {