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';
4
4
import { parse } from 'node:path' ;
5
5
import { readFile , writeFile , mkdir } from 'node:fs/promises' ;
6
6
import { fileURLToPath } from 'node:url' ;
7
+ import { exit } from 'node:process' ;
7
8
8
9
const glob = ( pattern ) => fastGlob . sync ( pattern , {
9
10
cwd : fileURLToPath ( new URL ( '..' , import . meta. url ) ) ,
10
11
absolute : true ,
11
12
} ) ;
12
13
13
- function exit ( err ) {
14
+ function doExit ( err ) {
14
15
if ( err ) console . error ( err ) ;
15
- process . exit ( err ? 1 : 0 ) ;
16
+ exit ( err ? 1 : 0 ) ;
16
17
}
17
18
18
19
async function processFile ( file , { prefix, fullName} = { } ) {
@@ -64,7 +65,7 @@ async function main() {
64
65
}
65
66
66
67
try {
67
- exit ( await main ( ) ) ;
68
+ doExit ( await main ( ) ) ;
68
69
} catch ( err ) {
69
- exit ( err ) ;
70
+ doExit ( err ) ;
70
71
}
You can’t perform that action at this time.
0 commit comments