From f810a6f69e6c33d8a2ed049feedbc139c0376de4 Mon Sep 17 00:00:00 2001 From: filipenevola Date: Sun, 17 Jan 2021 12:09:44 -0400 Subject: [PATCH] Adds --dry-run option on publish-release command --- tools/cli/commands-packages.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tools/cli/commands-packages.js b/tools/cli/commands-packages.js index dd1d2494a4..5ae2ad2b81 100644 --- a/tools/cli/commands-packages.js +++ b/tools/cli/commands-packages.js @@ -689,6 +689,8 @@ main.registerCommand({ options: { 'create-track': { type: Boolean }, 'from-checkout': { type: Boolean }, + // It is going to produce a fake error and nothing will be published + 'dry-run': { type: Boolean }, // Normally the publish-release script will complain if the source of // a core package differs in any way from what was previously // published for the current version of the package. However, if the @@ -985,6 +987,15 @@ main.registerCommand({ }); }); + if (options['dry-run']) { + main.captureAndExit("=> Dry run", function () { + buildmessage.error( + "This is not an error but it was just a validation" + + " and nothing was published. Remove --dry-run to publish."); + } + ) + } + // We now have an object of packages that have new versions on disk that // don't exist in the server catalog. Publish them. var unfinishedBuilds = {};