diff --git a/.npmignore b/.npmignore index cfbcdb5..d503a35 100644 --- a/.npmignore +++ b/.npmignore @@ -2,5 +2,6 @@ support compile test/ +docs/ examples .gitignore \ No newline at end of file diff --git a/dist/npmts.jsdoc.js b/dist/npmts.jsdoc.js index a68b628..467695c 100644 --- a/dist/npmts.jsdoc.js +++ b/dist/npmts.jsdoc.js @@ -32,7 +32,7 @@ var publishDocs = function (configArg) { + "&& git push --force --quiet " + "\"" + gitUrl + "\" " + "master:gh-pages " + "> /dev/null 2>&1"; - if (plugins.smartenv.getEnv().isTravis) { + if (plugins.smartenv.getEnv().isTravis && configArg.docs && configArg.docs.publish) { plugins.beautylog.log("now publishing docs to GitHub"); if (!plugins.shelljs.which('git')) { plugins.beautylog.error('Git is not installed'); diff --git a/test/assets/npmts.json b/test/assets/npmts.json index 63cc63e..513ec50 100644 --- a/test/assets/npmts.json +++ b/test/assets/npmts.json @@ -9,5 +9,8 @@ "./subts2/", "./customdir" ], - "coveralls":true + "coveralls":true, + "docs": { + "publish":true + } } \ No newline at end of file diff --git a/ts/npmts.jsdoc.ts b/ts/npmts.jsdoc.ts index eff82ed..ca2bfc8 100644 --- a/ts/npmts.jsdoc.ts +++ b/ts/npmts.jsdoc.ts @@ -39,8 +39,8 @@ var publishDocs = function(configArg){ + "\"" + gitUrl + "\" " + "master:gh-pages " + "> /dev/null 2>&1"; - if(plugins.smartenv.getEnv().isTravis){ - plugins.beautylog.log("now publishing docs to GitHub") + if(plugins.smartenv.getEnv().isTravis && configArg.docs && configArg.docs.publish){ + plugins.beautylog.log("now publishing docs to GitHub"); if (!plugins.shelljs.which('git')) { plugins.beautylog.error('Git is not installed'); plugins.shelljs.exit(1);