Skip to content

Commit

Permalink
docs: add doc comment for asExistingFile
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanoltman committed Jul 12, 2024
1 parent cf99f6e commit eac1158
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions updater_tools/lib/src/extensions/arg_results.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import 'package:args/args.dart';

/// Extension methods for validating options provided to [ArgResults].
extension ArgResultsValidation on ArgResults {
/// Returns the value of the option named [name] as a [File]. If the file
/// does not exist, an [ArgumentError] is thrown.
File asExistingFile(String name) {
final file = File(this[name] as String);
if (!file.existsSync()) {
Expand Down

0 comments on commit eac1158

Please sign in to comment.