diff --git a/bin/paragon-scripts.js b/bin/paragon-scripts.js index 1314238e810..6709fa63ec7 100755 --- a/bin/paragon-scripts.js +++ b/bin/paragon-scripts.js @@ -151,7 +151,7 @@ const COMMANDS = { ], }, help: { - executor: helpCommand, + executor: (args) => helpCommand(COMMANDS, args), parameters: [ { name: 'command', @@ -181,11 +181,6 @@ const COMMANDS = { return; } - if (command === HELP_COMMAND) { - helpCommand(COMMANDS, commandArgs); - return; - } - try { await executor.executor(commandArgs); } catch (error) { diff --git a/lib/build-scss.js b/lib/build-scss.js index 6ed27c4b487..9125cb81665 100755 --- a/lib/build-scss.js +++ b/lib/build-scss.js @@ -105,7 +105,7 @@ const compileAndWriteStyleSheets = ({ postCSS(commonPostCssPlugins) .process(compiledStyleSheet.css, { from: stylesPath, map: false }) .then((result) => { - postCSSCompilation.succeed(`Success compilation for ${capitalize(name)} stylesheet`); + postCSSCompilation.succeed(`Successfully compiled ${capitalize(name)} theme stylesheet`); fs.writeFileSync(`${outDir}/${name}.css`, result.css); postCSS([postCSSMinify()]) .process(result.css, { from: `${name}.css`, map: { inline: false } }) @@ -137,9 +137,7 @@ const compileAndWriteStyleSheets = ({ fs.writeFileSync(`${outDir}/${paragonThemeOutputFilename}`, `${JSON.stringify(paragonThemeOutput, null, 2)}\n`); }) .then(() => { - ora().succeed(chalk.underline.bold.green(`Stylesheets for ${capitalize(name)} build successfully!`)); - // eslint-disable-next-line no-console - console.log(); + ora().succeed(chalk.underline.bold.green(`Successfully built stylesheet for ${capitalize(name)} theme!\n`)); }) .catch((error) => { ora().fail(chalk.bold(`Failed to build stylesheets for ${capitalize(name)}: ${error.message}`)); @@ -152,11 +150,19 @@ const compileAndWriteStyleSheets = ({ * @param {Array} commandArgs - Command line arguments for building SCSS stylesheets. */ function buildScssCommand(commandArgs) { - const argv = minimist(commandArgs); - const corePath = argv.corePath || path.resolve(process.cwd(), 'styles/scss/core/core.scss'); - const themesPath = argv.themesPath || path.resolve(process.cwd(), 'styles/css/themes'); - const outDir = argv.outDir || './dist'; - const defaultThemeVariants = argv.defaultThemeVariants ? argv.defaultThemeVariants.split(',') : ['light']; + const defaultArgs = { + corePath: path.resolve(process.cwd(), 'styles/scss/core/core.scss'), + themesPath: path.resolve(process.cwd(), 'styles/css/themes'), + outDir: './dist', + defaultThemeVariants: 'light', + }; + + const { + corePath, + themesPath, + outDir, + defaultThemeVariants, + } = minimist(commandArgs, { default: defaultArgs }); // Core CSS compileAndWriteStyleSheets({