mirror of
https://github.com/facebook/lexical.git
synced 2025-08-06 16:39:33 +08:00
31 lines
847 B
JavaScript
31 lines
847 B
JavaScript
#!/usr/bin/env node
|
|
|
|
/**
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
const {exec} = require('child-process-promise');
|
|
const argv = require('minimist')(process.argv.slice(2));
|
|
|
|
const increment = argv.i;
|
|
const validIncrements = new Set(['minor', 'patch', 'prerelease']);
|
|
if (!validIncrements.has(increment)) {
|
|
console.error(`Invalid value for increment: ${increment}`);
|
|
process.exit(1);
|
|
}
|
|
|
|
async function incrementVersion() {
|
|
const preId = increment === 'prerelease' ? '--preid next' : '';
|
|
const workspaces = '';
|
|
const command = `npm --no-git-tag-version version ${increment} --include-workspace-root true ${preId} ${workspaces}`;
|
|
await exec(command);
|
|
}
|
|
|
|
incrementVersion();
|