Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cli): do not throw during migrate if project ID is passed through…
… flag (#7594) ### Description This PR sets the `apiClient`'s `requireProject` to `false` and instead only throws an error if both the cli config and the `--project` option are missing ### What to review Verify that the change is as expected and that the wording of the error is correct. ### Testing * create a simple migration script with sanity, `sanity migration create` and follow the prompt make sure there is no `sanity.cli.js` in your codebase Next steps: * Open /code/migrations/migration_id/index.ts in your code editor and write the code for your migration. * Dry run the migration with: `sanity migration run migration_id --project= --dataset` * Run the migration against a dataset with: `sanity migration run migration_id --project= --dataset --no-dry-run` * edit the script and run it as: `sanity migration run migration_id --project=real_project_id --dataset real_dataset` you should NOT get an error. Test again without specifying a `--project` project ID, you should see an error. ### Notes for release None <!-- Engineers do not need to worry about the final copy, but they must provide the docs team with enough context on: * What changed * How does one use it (code snippets, etc) * Are there limitations we should be aware of If this is PR is a partial implementation of a feature and is not enabled by default or if this PR does not contain changes that needs mention in the release notes (tooling chores etc), please call this out explicitly by writing "Part of feature X" or "Not required" in this section. --> --------- Co-authored-by: Espen Hovlandsdal <[email protected]>
- Loading branch information