mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-12 16:47:26 +02:00
fix: missing cli commands (#1478)
* fix: missing cli commands * centralize
This commit is contained in:
parent
be149e182f
commit
6b75bb3270
2 changed files with 6 additions and 10 deletions
|
@ -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');
|
||||
|
@ -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));
|
||||
|
|
|
@ -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`);
|
||||
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue