Skip to content

Commit

Permalink
add --if-exists flag to migrate command
Browse files Browse the repository at this point in the history
this is to prevent the action from exiting with error when there are no migrations
generated from the current migration, which is a perfectly valid case
  • Loading branch information
karadnik-flutterint committed May 15, 2024
1 parent 5ecb076 commit b1dc818
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41798,7 +41798,7 @@ function migrate(keepMigrationsFile) {
env: Object.assign(Object.assign({}, process.env), { npm_config_yes: String(true) })
});
yield (0, exec_1.exec)('npm install');
yield (0, exec_1.exec)('npx nx migrate --run-migrations=migrations.json --create-commits', [], {
yield (0, exec_1.exec)('npx nx migrate --run-migrations=migrations.json --if-exists --create-commits', [], {
env: Object.assign(Object.assign({}, process.env), { npm_config_yes: String(true), NX_MIGRATE_SKIP_INSTALL: String(true) })
});
// sometimes migrations change packages without installing them, so naivly install dependencies here again
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/nx-migrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export async function migrate(keepMigrationsFile: boolean): Promise<void> {
})
await exec('npm install')
await exec(
'npx nx migrate --run-migrations=migrations.json --create-commits',
'npx nx migrate --run-migrations=migrations.json --if-exists --create-commits',
[],
{
env: {
Expand Down

0 comments on commit b1dc818

Please sign in to comment.