replace console.log with nicelog (#1496)

This PR replaces our `console.log` with `nicelog` so that I can more
easily grep for errant console.logs.

### Change Type

- [x] `internal` — Any other changes that don't affect the published
package (will not publish a new version)
This commit is contained in:
Steve Ruiz 2023-06-01 19:01:49 +01:00 committed by GitHub
parent 0c4174c0b8
commit a3c39cde4b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 80 additions and 78 deletions

View file

@ -3,6 +3,7 @@ import json5 from 'json5'
import { basename, dirname, join, relative } from 'path'
import prettier from 'prettier'
import { fileURLToPath } from 'url'
import { nicelog } from './nicelog'
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
@ -61,16 +62,16 @@ export async function writeFile(filePath: string, contents: Buffer) {
// Ignore
}
if (existingContents && !existingContents.equals(contents)) {
console.log(
nicelog(
`Asset file ${relative(
REPO_ROOT,
filePath
)} has changed. Please run this script again and commit the changes.`
)
console.log('Contents before:')
console.log(existingContents.toString('utf-8'))
console.log('\nContents after:')
console.log(contents.toString('utf-8'))
nicelog('Contents before:')
nicelog(existingContents.toString('utf-8'))
nicelog('\nContents after:')
nicelog(contents.toString('utf-8'))
process.exit(1)
}