Skip to content

Commit

Permalink
fix not installing dependencies after migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
timonmasberg committed May 18, 2023
1 parent 933599d commit ccf0f52
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
4 changes: 4 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21427,6 +21427,10 @@ function migrate(keepMigrationsFile, legacyPeerDeps) {
yield (0, exec_1.exec)('npx nx migrate --run-migrations=migrations.json --create-commits', [], {
env: Object.assign(Object.assign({}, process.env), { npm_config_yes: 'true', npm_config_legacy_peer_deps: String(legacyPeerDeps) })
});
// sometimes migrations change packages without installing them, so naivly install dependencies here again
yield (0, exec_1.exec)('npm i', [], {
env: Object.assign(Object.assign({}, process.env), { npm_config_legacy_peer_deps: String(legacyPeerDeps) })
});
if (!keepMigrationsFile) {
fs_1.default.unlinkSync('./migrations.json');
}
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions src/nx-migrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,18 @@ export async function migrate(
}
}
)
// sometimes migrations change packages without installing them, so naivly install dependencies here again
await exec('npm i', [], {
env: {
...process.env,
npm_config_legacy_peer_deps: String(legacyPeerDeps)
}
})

if (!keepMigrationsFile) {
fs.unlinkSync('./migrations.json')
}

await exec('bash', [
'-c',
'(git add . && git commit -am "chore: [nx migration] changes") || true'
Expand Down

0 comments on commit ccf0f52

Please sign in to comment.