Skip to content

Commit

Permalink
Merge branch 'main' into chore/shorebird-cli-v1.6.4
Browse files Browse the repository at this point in the history
  • Loading branch information
felangel authored Jan 16, 2025
2 parents 7686475 + 048ec1b commit 4c8563c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,13 @@ class MacosNetworkEntitlementValidator extends Validator {
String get description => 'macOS app has Outgoing Connections entitlement';

@override
bool canRunInCurrentContext() =>
_macosDirectory != null && _macosDirectory!.existsSync();
bool canRunInCurrentContext() => _macosDirectory?.existsSync() ?? false;

@override
String? get incorrectContextMessage => '''
The ${_macosDirectory?.path ?? 'macos'} directory does not exist.
The command you are running must be run within a Flutter app project that supports the macOS platform.''';

@override
Future<List<ValidationIssue>> validate() async {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@ void main() {
runWithOverrides(() => validator.canRunInCurrentContext()),
isFalse,
);
expect(
runWithOverrides(() => validator.incorrectContextMessage),
contains(
'''The command you are running must be run within a Flutter app project that supports the macOS platform.''',
),
);
});
});
});
Expand Down

0 comments on commit 4c8563c

Please sign in to comment.