Skip to content

Commit

Permalink
refactor: renaming method to convert pubspec to map
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkOSullivan94 committed Jul 28, 2022
1 parent 3a2fe32 commit 9d088cc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/main.dart
Expand Up @@ -198,7 +198,7 @@ Map<String, dynamic>? loadConfigFileFromArgResults(ArgResults argResults, {bool
}

Map<String, dynamic> loadConfigFile(String path, String? fileOptionResult) {
final yamlMap = PubspecParser.toMap(path);
final yamlMap = PubspecParser.fromPathToMap(path);

if (yamlMap['flutter_icons'] is! Map) {
stderr.writeln(NoConfigFoundException('Check that your config file '
Expand Down
2 changes: 1 addition & 1 deletion lib/pubspec_parser.dart
Expand Up @@ -10,7 +10,7 @@ class PubspecParser {
PubspecParser._();

/// parses the pubspec located at [path] to map
static Map toMap(String path) {
static Map fromPathToMap(String path) {
final File file = File(path);
final String yamlString = file.readAsStringSync();
final Map yamlMap = loadYaml(yamlString);
Expand Down
2 changes: 1 addition & 1 deletion test/package_version_test.dart
Expand Up @@ -7,7 +7,7 @@ void main() {
/// build runner has not been run to up the version which is displayed
/// when flutter_launcher_icons is run
test('package version is correct', () {
final yamlMap = PubspecParser.toMap('pubspec.yaml');
final yamlMap = PubspecParser.fromPathToMap('pubspec.yaml');
final yamlVersion = yamlMap['version'] as String;
expect(
yamlVersion,
Expand Down

0 comments on commit 9d088cc

Please sign in to comment.