-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CLI: write into a log file if automigrations fail
- the errors will get supressed in normal output but shown in the log file
- Loading branch information
Showing
4 changed files
with
112 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { EOL } from 'os'; | ||
|
||
export const cleanLog = (str: string) => | ||
str | ||
// remove chalk ANSI colors | ||
// eslint-disable-next-line no-control-regex | ||
.replace(/\u001b\[.*?m/g, '') | ||
// fix boxen output | ||
.replace(/╮│/g, '╮\n│') | ||
.replace(/││/g, '│\n│') | ||
.replace(/│╰/g, '│\n╰') | ||
.replace(/⚠️ {2}failed to check/g, `${EOL}⚠️ failed to check`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters