Skip to content

Commit

Permalink
Added: handle deprecation warnings in commit.ts
Browse files Browse the repository at this point in the history
- Added a listener to remove all existing 'warning' listeners on the `process` object.
- Implemented a new listener to filter out `DeprecationWarning` related to 'punycode' and log other warnings.
- This change ensures that the application does not log unnecessary deprecation warnings related to 'punycode', improving the clarity of warning messages.
  • Loading branch information
SHSharkar committed Aug 16, 2024
1 parent 1fb9e68 commit 85e6d4e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/commands/commit.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
process.removeAllListeners('warning');
process.on('warning', (warning) => {
if (warning.name === 'DeprecationWarning' && warning.message.includes('punycode')) {
return;
}
console.warn(warning);
});

import { confirm, intro, isCancel, multiselect, outro, select, spinner } from '@clack/prompts';
import chalk from 'chalk';
import { execa } from 'execa';
Expand Down

0 comments on commit 85e6d4e

Please sign in to comment.