|
22 | 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
23 | 23 | * SOFTWARE. |
24 | 24 | */ |
| 25 | +import { spawn } from 'node:child_process' |
25 | 26 | import fs from 'fs' |
26 | 27 | import path from 'path' |
27 | 28 | import semver from 'semver' |
@@ -92,17 +93,25 @@ export async function bumpPackages(packageName, requestedVersion) { |
92 | 93 | let releaseVersion |
93 | 94 | console.log('\n\nDEBUG LOG 0.01: before info', args.join(' ')) |
94 | 95 | try { |
95 | | - await runCommandAsync('lerna', [ |
| 96 | + // native process run |
| 97 | + const cmdArgs = [ |
96 | 98 | 'version', |
97 | 99 | ...args, |
98 | | - '--exact', // exact versions, no ^ when bumping |
99 | | - '--include-merged-tags', // Include tags from merged branches |
100 | | - '--no-push', // do not execute `git push` |
101 | | - '--no-git-tag-version', // do not add git tag or commit |
102 | | - '--force-publish=*', // bump all packages even if they have no changes |
103 | | - '--conventional-commits', // determines new version and updates Changelog |
| 100 | + '--exact', |
| 101 | + '--include-merged-tags', |
| 102 | + '--no-push', |
| 103 | + '--no-git-tag-version', |
| 104 | + '--force-publish=*', |
| 105 | + '--conventional-commits', |
104 | 106 | '--loglevel=silly' |
105 | | - ]) |
| 107 | + ] |
| 108 | + await new Promise((resolve, reject) => { |
| 109 | + spawn('lerna', cmdArgs, { shell: true, stdio: 'inherit' }) |
| 110 | + .on('close', (code) => |
| 111 | + code === 0 ? resolve() : reject(new Error(`Exit code: ${code}`)) |
| 112 | + ) |
| 113 | + .on('error', reject) |
| 114 | + }) |
106 | 115 | // TODO REMOVE DEBUG LOG |
107 | 116 | console.log('\n\nDEBUG LOG 0.1: before syncRootPackageVersion') |
108 | 117 | releaseVersion = await syncRootPackageVersion(true) |
|
0 commit comments