Skip to content

Commit

Permalink
fix: missing cli commands
Browse files Browse the repository at this point in the history
  • Loading branch information
endiliey committed May 17, 2019
1 parent 5685e8a commit 817ac6e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
7 changes: 6 additions & 1 deletion packages/docusaurus-1.x/lib/server/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ async function execute() {
const imageminSvgo = require('imagemin-svgo');
const imageminGifsicle = require('imagemin-gifsicle');

commander.option('--skip-image-compression').parse(process.argv);
commander
.option('--skip-image-compression')
.option('--skip-next-release')
.parse(process.argv);

process.env.SKIP_NEXT_RELEASE = commander.skipNextRelease;

// create the folder path for a file if it does not exist, then write the file
function writeFileAndCreateFolder(file, content) {
Expand Down
9 changes: 1 addition & 8 deletions packages/docusaurus-1.x/lib/server/readMetadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const CWD = process.cwd();
const path = require('path');
const fs = require('fs');
const glob = require('glob');
const program = require('commander');

const metadataUtils = require('./metadataUtils');

Expand Down Expand Up @@ -38,8 +37,6 @@ const SupportedHeaderFields = new Set([
'custom_edit_url',
]);

program.option('--skip-next-release').parse(process.argv);

let allSidebars;
if (fs.existsSync(`${CWD}/sidebars.json`)) {
allSidebars = require(`${CWD}/sidebars.json`);
Expand All @@ -58,11 +55,7 @@ function getDocsPath() {
}

function shouldGenerateNextReleaseDocs() {
return !(
env.versioning.enabled &&
program.name() === 'docusaurus-build' &&
program.skipNextRelease
);
return !(env.versioning.enabled && process.env.SKIP_NEXT_RELEASE);
}

// returns map from id to object containing sidebar ordering info
Expand Down

0 comments on commit 817ac6e

Please sign in to comment.