Skip to content

Commit

Permalink
Use File instead of File.fromUri
Browse files Browse the repository at this point in the history
Fixes ScerIO#19
File.fromUri throws UnsupportedError if file doesn't exist
  • Loading branch information
Gaurav192 committed Dec 7, 2021
1 parent 76d8e8e commit 134cfbd
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions bin/icon_font_generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,8 @@ class GenerateCommand extends Command {
Directory.fromUri(genRootDir.uri.resolve('temp_icons'));
final tempOutDirectory =
Directory.fromUri(genRootDir.uri.resolve('temp_font'));
final iconsMap = File.fromUri(genRootDir.uri.resolve(path.join(
tempOutDirectory.path,
path.basenameWithoutExtension(argResults!['out-font']) + '.json')));
final iconsMap = File(path.join(tempOutDirectory.path,
path.basenameWithoutExtension(argResults!['out-font']) + '.json'));
if (tempSourceDirectory.existsSync()) {
await tempSourceDirectory.delete(recursive: true);
}
Expand Down Expand Up @@ -139,11 +138,12 @@ class GenerateCommand extends Command {

final sourceIconsDirectory = Directory.fromUri(Directory.current.uri
.resolve(argResults!['from'].replaceAll('\\', '/')));
final outIconsFile = File.fromUri(Directory.current.uri
.resolve(argResults!['out-font'].replaceAll('\\', '/')));
final outFlutterClassFile = File.fromUri(Directory.current.uri
.resolve(argResults!['out-flutter'].replaceAll('\\', '/')));

final outIconsFile = File(Directory.fromUri(Directory.current.uri
.resolve(argResults!['out-font'].replaceAll('\\', '/')))
.path);
final outFlutterClassFile = File(Directory.fromUri(Directory.current.uri
.resolve(argResults!['out-flutter'].replaceAll('\\', '/')))
.path);
await tempSourceDirectory.create();
await tempOutDirectory.create();

Expand Down

0 comments on commit 134cfbd

Please sign in to comment.