Skip to content

Commit

Permalink
refactor: use outputSvgExists variable for checking existence of ou…
Browse files Browse the repository at this point in the history
…tputSvgPath file
  • Loading branch information
OnurGvnc committed May 16, 2024
1 parent d559d48 commit aa6c94d
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,11 @@ export const iconsSpritesheet: (args: PluginProps) => Plugin = ({ withTypes, inp
},
async configResolved(config) {
const outputSvgPath = normalizePath(path.join(cwd ?? process.cwd(), outputDir, fileName ?? "sprite.svg"));
if (
!(await fs
.access(outputSvgPath, fs.constants.F_OK)
.then(() => true)
.catch(() => false))
) {
const outputSvgExists = await fs
.access(outputSvgPath, fs.constants.F_OK)
.then(() => true)
.catch(() => false);
if (!outputSvgExists) {
await generateIcons({
withTypes,
inputDir,
Expand Down

0 comments on commit aa6c94d

Please sign in to comment.