Skip to content

Commit

Permalink
fixup!: Review feedback add help etc
Browse files Browse the repository at this point in the history
  • Loading branch information
xitij2000 committed Jan 4, 2024
1 parent 2ae8f94 commit fd4d634
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
12 changes: 11 additions & 1 deletion bin/paragon-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,19 @@ const COMMANDS = {
},
{
name: '-t, --themes',
description: 'Specify themes to include in the token build.',
description: 'Specify themes to include in the token build. Eg. light,dark or "light dark"',
defaultValue: 'light',
},
{
name: '--base-theme',
description: 'Specify the base theme to use in the token build. For example, to build the "high-contrast" theme on top of the ligth theme use "--theme high-contrast --base-theme light".',
defaultValue: 'Same as theme',
},
{
name: '--all-themes',
description: 'Build tokens for all themes in the source directory.',
defaultValue: false,
},
],
},
'replace-variables': {
Expand Down
7 changes: 5 additions & 2 deletions lib/build-tokens.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,15 @@ async function buildTokensCommand(commandArgs) {
let themesToProcess = null;

if (allThemes) {
const tokensPath = tokensSource || path.resolve(__dirname, '../tokens/src');
themesToProcess = fs
.readdirSync(`${tokensSource}/themes/`, { withFileTypes: true })
.readdirSync(`${tokensPath}/themes/`, { withFileTypes: true })
.filter(entry => entry.isDirectory())
.map(entry => entry.name);
} else if (Array.isArray(themes)) {
themesToProcess = themes;
} else {
themesToProcess = themes.split(' ');
themesToProcess = themes.split(/[\s,]/);
}

const coreConfig = {
Expand Down

0 comments on commit fd4d634

Please sign in to comment.