Skip to content

Commit

Permalink
fix: fix yarn install cwd
Browse files Browse the repository at this point in the history
  • Loading branch information
antongolub committed Jun 25, 2022
1 parent b2958c4 commit c6f0ae3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 0 additions & 2 deletions src/main/js/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ export const build = (pkg, packages) => ctx(async ($) => {
console.log(`tested '${pkg.name}'`)
}
}

await $`yarn`
}

pkg.built = true
Expand Down
13 changes: 8 additions & 5 deletions src/main/js/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import {fs} from 'zx-extra'
import {fs, ctx} from 'zx-extra'
import {topo} from '@semrel-extra/topo'
import {updateDeps} from './deps.js'
import {getSemanticChanges, resolvePkgVersion} from './analyze.js'
import {publish, getLatest} from './publish.js'
import {build} from './build.js'

export const run = async ({cwd = process.cwd(), env = process.env, flags = {}} = {}) => {
console.log('Run zx bulk release')
const {packages, queue} = await topo({cwd})
export const run = ({cwd = process.cwd(), env = process.env, flags = {}} = {}) => ctx(async ($) => {
const {packages, queue, root} = await topo({cwd})
const dryRun = flags['dry-run'] || flags.dryRun

for (let name of queue) {
Expand All @@ -26,9 +25,13 @@ export const run = async ({cwd = process.cwd(), env = process.env, flags = {}} =
console.log(`semantic changes of '${name}'`, changes)

pkg.build = await build(pkg, packages)

$.cwd = cwd
await $`yarn`

if (dryRun) continue

await fs.writeJson(pkg.manifestPath, pkg.manifest, {spaces: 2})
await publish(pkg, env)
}
}
})
3 changes: 2 additions & 1 deletion src/test/js/integration.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ const cwd = await createFakeRepo({
relpath: './package.json',
contents: {
name: 'root',
workspaces: ['packages/*']
workspaces: ['packages/*'],
private: true,
}
}
]
Expand Down

0 comments on commit c6f0ae3

Please sign in to comment.