Skip to content

Commit c908d16

Browse files
committed
fix deprecation warning for --emit-dts aliases appearing twice
1 parent ecb2810 commit c908d16

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/bin/hsm.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ if (commands[0] == `v` || commands[0] == `version` || popOption(`version`, `v`)?
9898
process.exit()
9999
}
100100

101+
let warnedDeprecatedEmitDtsAlias = false
102+
101103
if (popOption(`help`, `h`)?.value) {
102104
logHelp()
103105
process.exit()
@@ -374,6 +376,8 @@ Warning: ${formatOption(dtsPathOption.name)} is being deprecated and will be rem
374376
case `gen-types`:
375377
case `emit-dts`: {
376378
if (commands[0] != `emit-dts` && commands[0] != `gen-dts`) {
379+
warnedDeprecatedEmitDtsAlias = true
380+
377381
console.warn(colourF(`\
378382
Warning: ${colourC(`hsm`)} ${colourL(commands[0])} is being deprecated and will be removed
379383
in the next minor release of HSM
@@ -530,7 +534,7 @@ ${colourN(`--watch`)}
530534
case `gen-dts`:
531535
case `gen-types`:
532536
case `emit-dts`: {
533-
if (commands[0] != `emit-dts` && commands[0] != `gen-dts`) {
537+
if (!warnedDeprecatedEmitDtsAlias && commands[0] != `emit-dts` && commands[0] != `gen-dts`) {
534538
console.warn(colourF(`\
535539
Warning: ${colourC(`hsm`)} ${colourL(commands[0])} is being deprecated and will be removed
536540
in the next minor release of HSM

0 commit comments

Comments
 (0)