Skip to content

Commit b1dc818

Browse files
add --if-exists flag to migrate command
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
1 parent 5ecb076 commit b1dc818

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

dist/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41798,7 +41798,7 @@ function migrate(keepMigrationsFile) {
4179841798
env: Object.assign(Object.assign({}, process.env), { npm_config_yes: String(true) })
4179941799
});
4180041800
yield (0, exec_1.exec)('npm install');
41801-
yield (0, exec_1.exec)('npx nx migrate --run-migrations=migrations.json --create-commits', [], {
41801+
yield (0, exec_1.exec)('npx nx migrate --run-migrations=migrations.json --if-exists --create-commits', [], {
4180241802
env: Object.assign(Object.assign({}, process.env), { npm_config_yes: String(true), NX_MIGRATE_SKIP_INSTALL: String(true) })
4180341803
});
4180441804
// sometimes migrations change packages without installing them, so naivly install dependencies here again

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/nx-migrate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export async function migrate(keepMigrationsFile: boolean): Promise<void> {
1010
})
1111
await exec('npm install')
1212
await exec(
13-
'npx nx migrate --run-migrations=migrations.json --create-commits',
13+
'npx nx migrate --run-migrations=migrations.json --if-exists --create-commits',
1414
[],
1515
{
1616
env: {

0 commit comments

Comments
 (0)