Add messaging around first-run behaviour (#17)

* wip: add messaging

* chore: typo
This commit is contained in:
Marc Cataford 2020-05-01 21:30:42 -04:00 committed by GitHub
parent 7d120b14c0
commit 278f86e5cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -33,6 +33,12 @@ if (!existsSync(MANIFEST_FILENAME)) {
console.log( console.log(
`Package size (${currentStats.packageSize}) adopted as new limit.`, `Package size (${currentStats.packageSize}) adopted as new limit.`,
) )
if (!isUpdatingManifest) {
console.log(
'❗ It looks like you ran PackWatch without a manifest. To prevent accidental passes in CI or hooks, packwatch will terminate with an error. If you are running packwatch for the first time in your project, this is expected!',
)
}
// If the update flag wasn't specified, exit with a non-zero code so we // If the update flag wasn't specified, exit with a non-zero code so we
// don't "accidentally" pass CI builds if the manifest didn't exist // don't "accidentally" pass CI builds if the manifest didn't exist
process.exit(isUpdatingManifest ? 0 : 1) process.exit(isUpdatingManifest ? 0 : 1)