From 18985db3f0eb8eb8c79decd4877f0a8ba52a4d33 Mon Sep 17 00:00:00 2001 From: Michael Kauzmann Date: Thu, 10 Oct 2024 13:18:12 -0600 Subject: [PATCH] fix up maintenance-create-patch.ts, https://github.com/phetsims/chipper/issues/1461 --- js/grunt/tasks/maintenance-create-patch.ts | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/js/grunt/tasks/maintenance-create-patch.ts b/js/grunt/tasks/maintenance-create-patch.ts index 4da21355..a171ac20 100644 --- a/js/grunt/tasks/maintenance-create-patch.ts +++ b/js/grunt/tasks/maintenance-create-patch.ts @@ -1,14 +1,29 @@ // Copyright 2024, University of Colorado Boulder /** - * Reports out on release branch statuses + * Adds a patch to the maintenance process + * @author Jonathan Olson * @author Michael Kauzmann (PhET Interactive Simulations) */ +import assert from 'assert'; import winston from 'winston'; -import Maintenance from '../../common/Maintenance'; +import assertIsValidRepoName from '../../common/assertIsValidRepoName.js'; +import Maintenance from '../../common/Maintenance.js'; +import getOption from './util/getOption'; winston.default.transports.console.level = 'error'; // TODO: Does this belong in grunt? See https://github.com/phetsims/chipper/issues/1461 -( async () => Maintenance.checkBranchStatus() )(); \ No newline at end of file +( async () => { + + const repo = getOption( 'repo' ); + assertIsValidRepoName( repo ); + + const message = getOption( 'message' ); + + assert( repo, 'Requires specifying a repo that will need to be patched with --repo={{REPO}}' ); + assert( message, 'Requires specifying a message (included with commits) with --message={{MESSAGE}}' ); + + await Maintenance.createPatch( repo, message ); +} )(); \ No newline at end of file