Skip to content

Commit

Permalink
test(workflows): build-tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverschuerch committed Jul 18, 2024
1 parent 4db0dcc commit 887de72
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-tokens.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
const inputFileNames = fs.readdirSync('packages/tokens/tokensstudio-generated')
const inputFiles = inputFileNames.map(fileName => ({
type: path.extname(fileName),
type: path.extname(fileName).replace(/^\./, ''),
name: fileName,
content: fs.readFileSync(`packages/tokens/tokensstudio-generated/${fileName}`, 'utf8')
}))
Expand All @@ -48,7 +48,7 @@ jobs:
]
const outputFileNames = fs.readdirSync('packages/tokens/dist')
const outputFiles = outputFileNames.map(fileName => ({
type: path.extname(fileName),
type: path.extname(fileName).replace(/^\./, ''),
name: fileName,
content: fs.readFileSync(`packages/tokens/dist/${fileName}`, 'utf8')
})).sort((a, b) => (outputOrder.includes(a.name) ? outputOrder.indexOf(a.name) : 1000) - (outputOrder.includes(b.name) ? outputOrder.indexOf(b.name) : 1000))
Expand All @@ -63,7 +63,7 @@ jobs:
## Output
${outputFiles.map(({ type, name, content }) => `<details>
<summary><code>${name}</code></summary>
<pre lang="${type}">${content}</pre>
<pre lang="${type}">${type === 'scss' ? content.replaceAll('\n\n', '\n&nbsp;\n').replaceAll('$', '&#36;').replaceAll(' ', '&nbsp;&nbsp;') : content}</pre>
</details>`).join('\n')}
`
Expand Down

0 comments on commit 887de72

Please sign in to comment.