Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: missing cli commands #1478

Merged
merged 2 commits into from
May 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions packages/docusaurus-1.x/lib/server/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
*/

async function execute() {
const commander = require('commander');
commander
.option('--skip-image-compression')
.option('--skip-next-release')
.parse(process.argv);
require('../write-translations.js');
const metadataUtils = require('./metadataUtils');
const blog = require('./blog');
Expand All @@ -30,15 +35,12 @@ async function execute() {
const sep = path.sep;
const escapeStringRegexp = require('escape-string-regexp');
const {renderToStaticMarkupWithDoctype} = require('./renderUtils');
const commander = require('commander');
const imagemin = require('imagemin');
const imageminJpegtran = require('imagemin-jpegtran');
const imageminOptipng = require('imagemin-optipng');
const imageminSvgo = require('imagemin-svgo');
const imageminGifsicle = require('imagemin-gifsicle');

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

// create the folder path for a file if it does not exist, then write the file
function writeFileAndCreateFolder(file, content) {
mkdirp.sync(path.dirname(file));
Expand Down
8 changes: 1 addition & 7 deletions packages/docusaurus-1.x/lib/server/readMetadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,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 +56,7 @@ function getDocsPath() {
}

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

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