Skip to content

Commit 4b5ff1d

Browse files
committed
Silency punycode warnings
1 parent 10c25da commit 4b5ff1d

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/Components/ServerlessFramework.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@
1616

1717
class ServerlessFramework
1818
{
19+
private const IGNORED_LOGS = [
20+
'https://dashboard.bref.sh',
21+
'(node:83031) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.',
22+
'(Use `node --trace-deprecation ...` to show where the warning was created)',
23+
];
24+
1925
/**
2026
* @param array{ accessKeyId: string, secretAccessKey: string, sessionToken: string } $awsCredentials
2127
* @throws ProcessException
@@ -35,14 +41,19 @@ public function deploy(int $deploymentId, string $environment, array $awsCredent
3541
async(function () use ($process, &$newLogs) {
3642
while (($chunk = $process->getStdout()->read()) !== null) {
3743
if (empty($chunk)) continue;
44+
foreach (self::IGNORED_LOGS as $ignoredLog) {
45+
if (str_contains($chunk, $ignoredLog)) continue 2;
46+
}
3847
IO::verbose($chunk);
3948
$newLogs .= $chunk;
4049
}
4150
});
4251
async(function () use ($process, &$newLogs) {
4352
while (($chunk = $process->getStderr()->read()) !== null) {
4453
if (empty($chunk)) continue;
45-
if (str_contains($chunk, 'https://dashboard.bref.sh')) continue;
54+
foreach (self::IGNORED_LOGS as $ignoredLog) {
55+
if (str_contains($chunk, $ignoredLog)) continue 2;
56+
}
4657
IO::verbose($chunk);
4758
$newLogs .= $chunk;
4859
}

0 commit comments

Comments
 (0)