From 16e0ea7ff0f0998eb723bfa2291d3ea9d1c84039 Mon Sep 17 00:00:00 2001 From: Michael Rose Date: Sun, 8 Mar 2020 13:12:49 -0400 Subject: [PATCH] feat: Only generate manifest if update is specified (#8) * Only generate manifest if update is specified BREAKING CHANGE: packwatch will now exit with a non-zero code if run without an existing manifest file and without the --update-manifest flag. Now run packwatch --update-manifest to generate a manifest for the first time. * Fail but still generate manifest --- src/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index d3f3f23..2db8afa 100644 --- a/src/index.js +++ b/src/index.js @@ -33,7 +33,9 @@ if (!existsSync(MANIFEST_FILENAME)) { console.log( `Package size (${currentStats.packageSize}) adopted as new limit.`, ) - process.exit(0) + // 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 + process.exit(isUpdatingManifest ? 0 : 1) } const previousStats = getPreviousPackageStats()