Skip to content

Commit aa6c94d

Browse files
committed
refactor: use outputSvgExists variable for checking existence of outputSvgPath file
1 parent d559d48 commit aa6c94d

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

src/index.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,11 @@ export const iconsSpritesheet: (args: PluginProps) => Plugin = ({ withTypes, inp
143143
},
144144
async configResolved(config) {
145145
const outputSvgPath = normalizePath(path.join(cwd ?? process.cwd(), outputDir, fileName ?? "sprite.svg"));
146-
if (
147-
!(await fs
148-
.access(outputSvgPath, fs.constants.F_OK)
149-
.then(() => true)
150-
.catch(() => false))
151-
) {
146+
const outputSvgExists = await fs
147+
.access(outputSvgPath, fs.constants.F_OK)
148+
.then(() => true)
149+
.catch(() => false);
150+
if (!outputSvgExists) {
152151
await generateIcons({
153152
withTypes,
154153
inputDir,

0 commit comments

Comments
 (0)