Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(shorebird_cli): add --dry-run and --force to shorebird patch #207

Merged
merged 6 commits into from
Mar 31, 2023

Conversation

felangel
Copy link
Contributor

Description

  • feat(shorebird_cli): add --dry-run and --force to patch

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore

@felangel felangel added the enhancement New feature or request label Mar 31, 2023
@felangel felangel requested review from eseidel and bryanoltman March 31, 2023 14:41
@felangel felangel self-assigned this Mar 31, 2023
@felangel felangel changed the title feat(shorebird_cli): add --dry-run and --force to patch feat(shorebird_cli): add --dry-run and --force to shorebird patch Mar 31, 2023
@@ -94,6 +106,14 @@ class PatchCommand extends ShorebirdCommand
return ExitCode.software.code;
}

final force = results['force'] == true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine, but isn't this also solved by adding default: false to the addFlag?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then it's just results['force']? Donno which is clearer. 🤷

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried this – results['force'] is still null if no arg is provided.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

default: false is the default but accessing arg flags is dynamic which is why I wrote it this way.

@@ -433,9 +452,6 @@ Please create a release using "shorebird release" and try again.

test('throws error when release artifact cannot be retrieved.', () async {
const error = 'something went wrong';
when(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are these no longer needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are the default stubs so they were unnecessary

@felangel felangel merged commit 24e038f into main Mar 31, 2023
@felangel felangel deleted the feat/shorebird-cli-add-force-and-dry-run-to-patch branch March 31, 2023 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants