Skip to content

Commit 90528f7

Browse files
committed
fix: update deps
Fixes upstream issue in visualizer-on-tabs. Replace minimist with node built-in arg parsing. This changes the parsing but shouldn't affect type of arguments used by the build command.
1 parent 431f164 commit 90528f7

File tree

4 files changed

+966
-968
lines changed

4 files changed

+966
-968
lines changed

bin/build.js

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,31 @@
22

33
import { tmpdir } from 'node:os';
44
import path from 'node:path';
5-
import process from 'node:process';
6-
7-
import minimist from 'minimist';
5+
import { parseArgs } from 'node:util';
86

97
import { build } from '../src/index.js';
108
import { acquireLock, releaseLock } from '../src/lock.js';
119
import log from '../src/log.js';
1210

13-
let args = minimist(process.argv.slice(2));
14-
const configFiles =
15-
typeof args.config === 'string' ? args.config.split(',') : args.config;
11+
const parsedResults = parseArgs({
12+
options: {
13+
config: { type: 'string', multiple: true, short: 'c', default: [] },
14+
},
15+
strict: false,
16+
});
17+
18+
const configFiles = parsedResults.values.config.flatMap((v) => v.split(','));
1619

1720
const pidFile = path.join(tmpdir(), 'flavor-builder.pid');
1821
let isProcessLocked = acquireLock(pidFile);
1922
if (isProcessLocked) {
2023
throw new Error('flavor-builder already running');
2124
}
2225

26+
if (configFiles.length === 0) {
27+
log.info('No config file specified, nothing to do');
28+
}
29+
2330
for (let i = 0; i < configFiles.length; i++) {
2431
await build(configFiles[i]);
2532
}

0 commit comments

Comments
 (0)