File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -4,15 +4,16 @@ import {optimize} from 'svgo';
44import { parse } from 'node:path' ;
55import { readFile , writeFile , mkdir } from 'node:fs/promises' ;
66import { fileURLToPath } from 'node:url' ;
7+ import { exit } from 'node:process' ;
78
89const glob = ( pattern ) => fastGlob . sync ( pattern , {
910 cwd : fileURLToPath ( new URL ( '..' , import . meta. url ) ) ,
1011 absolute : true ,
1112} ) ;
1213
13- function exit ( err ) {
14+ function doExit ( err ) {
1415 if ( err ) console . error ( err ) ;
15- process . exit ( err ? 1 : 0 ) ;
16+ exit ( err ? 1 : 0 ) ;
1617}
1718
1819async function processFile ( file , { prefix, fullName} = { } ) {
@@ -64,7 +65,7 @@ async function main() {
6465}
6566
6667try {
67- exit ( await main ( ) ) ;
68+ doExit ( await main ( ) ) ;
6869} catch ( err ) {
69- exit ( err ) ;
70+ doExit ( err ) ;
7071}
You can’t perform that action at this time.
0 commit comments