Skip to content

Commit afc782c

Browse files
committed
fix: auto-create parent directories for output path
1 parent f60c229 commit afc782c

3 files changed

Lines changed: 21 additions & 8 deletions

File tree

‎dist/index.js‎

Lines changed: 17 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎dist/index.js.map‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/main.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { writeFileSync } from 'node:fs'
1+
import { mkdirSync, writeFileSync } from 'node:fs'
2+
import { dirname } from 'node:path'
23
import * as core from '@actions/core'
34
import { gensvg } from './gensvg.js'
45

@@ -44,6 +45,7 @@ export async function run(): Promise<void> {
4445
textColor
4546
})
4647

48+
mkdirSync(dirname(outputPath), { recursive: true })
4749
writeFileSync(outputPath, svg, 'utf-8')
4850
core.info(`SVG written to: ${outputPath}`)
4951

0 commit comments

Comments
 (0)