Skip to content

Commit

Permalink
Change overwriteChanges to overwrite, see phetsims/phet-io#1749
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Apr 7, 2021
1 parent 64b76d5 commit ce0cf94
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions js/grunt/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,8 @@ Updates the normal automatically-generated files for this repository. Includes:
'--sims=... a list of sims to compare (defaults to the sim in the current dir)\n' +
'--simList=... a file with a list of sims to compare (defaults to the sim in the current dir)\n' +
'--delta, by default a breaking-compatibility comparison is done, but --delta shows all changes\n' +
'--temporary, compares api files in the temporary directory (otherwise compares to freshly generated apis)',
'--temporary, compares api files in the temporary directory (otherwise compares to freshly generated apis)\n' +
'--overwrite - to adopt the changes, breaking or design changes (depending on package.json) and write the new api in phet-io/api/',
wrapTask( async () => {

const sims = getSimList().length === 0 ? [ repo ] : getSimList();
Expand All @@ -535,7 +536,7 @@ Updates the normal automatically-generated files for this repository. Includes:

await phetioCompareAPISets( sims, proposedAPIs, {
delta: grunt.option( 'delta' ),
overwriteChanges: grunt.option( 'overwriteChanges' )
overwrite: grunt.option( 'overwrite' )
} );
} )
);
Expand Down
4 changes: 2 additions & 2 deletions js/phet-io/phetioCompareAPISets.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const API_DIR = '../phet-io/api';
module.exports = async ( repos, proposedAPIs, options ) => {
options = _.extend( {
delta: false,
overwriteChanges: false
overwrite: false
}, options );

repos.forEach( repo => {
Expand Down Expand Up @@ -48,7 +48,7 @@ module.exports = async ( repos, proposedAPIs, options ) => {
}
}

if ( options.overwriteChanges ) {
if ( options.overwrite ) {
fs.writeFileSync( `${API_DIR}/${repo}.json`, formatPhetioAPI( comparisonData.newAPI ), 'utf8' );
}
} );
Expand Down

0 comments on commit ce0cf94

Please sign in to comment.