mirror of
https://github.com/morten-olsen/reservoir.git
synced 2026-02-07 17:36:24 +01:00
17 lines
499 B
JavaScript
17 lines
499 B
JavaScript
import { readFile, writeFile } from 'fs/promises';
|
|
import { join } from 'path';
|
|
import process from 'process';
|
|
|
|
import { findWorkspacePackages } from '@pnpm/find-workspace-packages';
|
|
|
|
const packages = await findWorkspacePackages(process.cwd());
|
|
|
|
for (const pkg of packages) {
|
|
const pkgPath = join(pkg.dir, 'package.json');
|
|
const pkgJson = JSON.parse(await readFile(pkgPath, 'utf-8'));
|
|
|
|
pkgJson.version = process.argv[2];
|
|
|
|
await writeFile(pkgPath, JSON.stringify(pkgJson, null, 2) + '\n');
|
|
}
|