mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-12 08:37:25 +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() {
|
async function execute() {
|
||||||
|
const commander = require('commander');
|
||||||
|
commander
|
||||||
|
.option('--skip-image-compression')
|
||||||
|
.option('--skip-next-release')
|
||||||
|
.parse(process.argv);
|
||||||
require('../write-translations.js');
|
require('../write-translations.js');
|
||||||
const metadataUtils = require('./metadataUtils');
|
const metadataUtils = require('./metadataUtils');
|
||||||
const blog = require('./blog');
|
const blog = require('./blog');
|
||||||
|
@ -30,15 +35,12 @@ async function execute() {
|
||||||
const sep = path.sep;
|
const sep = path.sep;
|
||||||
const escapeStringRegexp = require('escape-string-regexp');
|
const escapeStringRegexp = require('escape-string-regexp');
|
||||||
const {renderToStaticMarkupWithDoctype} = require('./renderUtils');
|
const {renderToStaticMarkupWithDoctype} = require('./renderUtils');
|
||||||
const commander = require('commander');
|
|
||||||
const imagemin = require('imagemin');
|
const imagemin = require('imagemin');
|
||||||
const imageminJpegtran = require('imagemin-jpegtran');
|
const imageminJpegtran = require('imagemin-jpegtran');
|
||||||
const imageminOptipng = require('imagemin-optipng');
|
const imageminOptipng = require('imagemin-optipng');
|
||||||
const imageminSvgo = require('imagemin-svgo');
|
const imageminSvgo = require('imagemin-svgo');
|
||||||
const imageminGifsicle = require('imagemin-gifsicle');
|
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
|
// create the folder path for a file if it does not exist, then write the file
|
||||||
function writeFileAndCreateFolder(file, content) {
|
function writeFileAndCreateFolder(file, content) {
|
||||||
mkdirp.sync(path.dirname(file));
|
mkdirp.sync(path.dirname(file));
|
||||||
|
|
|
@ -38,8 +38,6 @@ const SupportedHeaderFields = new Set([
|
||||||
'custom_edit_url',
|
'custom_edit_url',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
program.option('--skip-next-release').parse(process.argv);
|
|
||||||
|
|
||||||
let allSidebars;
|
let allSidebars;
|
||||||
if (fs.existsSync(`${CWD}/sidebars.json`)) {
|
if (fs.existsSync(`${CWD}/sidebars.json`)) {
|
||||||
allSidebars = require(`${CWD}/sidebars.json`);
|
allSidebars = require(`${CWD}/sidebars.json`);
|
||||||
|
@ -58,11 +56,7 @@ function getDocsPath() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function shouldGenerateNextReleaseDocs() {
|
function shouldGenerateNextReleaseDocs() {
|
||||||
return !(
|
return !(env.versioning.enabled && program.skipNextRelease);
|
||||||
env.versioning.enabled &&
|
|
||||||
program.name() === 'docusaurus-build' &&
|
|
||||||
program.skipNextRelease
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// returns map from id to object containing sidebar ordering info
|
// returns map from id to object containing sidebar ordering info
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue