mirror of
https://github.com/logto-io/logto.git
synced 2024-12-23 20:33:16 -05:00
6fd1e9cc56
* chore: pass arguments to version script * release: version packages --------- Co-authored-by: Gao Sun <gao@silverhand.io>
29 lines
829 B
JavaScript
29 lines
829 B
JavaScript
import { exec } from 'node:child_process';
|
|
import { promisify } from 'node:util';
|
|
|
|
const execAsync = promisify(exec);
|
|
|
|
const cmd = ['pnpm changeset version', ...process.argv.slice(2)].join(' ');
|
|
|
|
const catchCmdError = ({ stderr, stdout, code }) => {
|
|
console.log(stdout);
|
|
console.error(stderr);
|
|
process.exit(code ?? 1);
|
|
};
|
|
|
|
console.log(cmd);
|
|
|
|
await execAsync(cmd).catch(catchCmdError);
|
|
|
|
// Manually run lifecycle script since changesets didn't
|
|
await execAsync(`pnpm -r version`).catch(catchCmdError);
|
|
|
|
// Sanity check for prepublish scripts
|
|
await execAsync(`pnpm -r prepack`).catch(catchCmdError);
|
|
await execAsync(`pnpm -r prepublishOnly`).catch(catchCmdError);
|
|
|
|
// Update lockfile
|
|
await execAsync(`pnpm i --no-frozen-lockfile`).catch(catchCmdError);
|
|
|
|
// Show Git changes
|
|
await execAsync(`git status`).catch(catchCmdError);
|