File tree Expand file tree Collapse file tree 1 file changed +4
-10
lines changed
Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -8,21 +8,15 @@ import 'package:collection/collection.dart';
88void main (List <String > arguments) {
99 try {
1010 final (sourceFile, config) = init (arguments);
11-
12- final sourceString = mapException (
13- sourceFile.readAsStringSync,
14- (_) => 'Error while reading source from "${sourceFile .path }"' ,
15- );
16-
11+ final sourceString = sourceFile.readAsStringSync ();
1712 final newSource = createNewSource (sourceString, config);
1813 if (newSource == sourceString) return ;
1914
20- mapException (
21- () => sourceFile.writeAsStringSync (newSource),
22- (_) => 'Error while writing new source to "${sourceFile .path }"' ,
23- );
15+ sourceFile.writeAsStringSync (newSource);
2416 } on String catch (e) {
2517 print (e);
18+ } on FileSystemException catch (e) {
19+ print ('Error while accessing ${e .path }' );
2620 }
2721}
2822
You can’t perform that action at this time.
0 commit comments