Skip to content

Commit 6624ad6

Browse files
authored
Work around Dart 3.13 breaking node_io (#301)
1 parent b9c56e4 commit 6624ad6

3 files changed

Lines changed: 12 additions & 7 deletions

File tree

lib/src/io.dart

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,4 @@
44
// license that can be found in the LICENSE file or at
55
// https://opensource.org/licenses/MIT.
66

7-
// These libraries don't expose *exactly* the same API, but they overlap in all
8-
// the cases we care about.
9-
export 'dart:io' if (dart.library.js) 'package:node_io/node_io.dart';
10-
11-
// For cases that aren't covered by `node_io`.
127
export 'io/vm.dart' if (dart.library.js) 'io/node.dart';

lib/src/io/node.dart

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
import 'package:file/file.dart';
88
import 'package:js/js.dart';
99
import 'package:node_interop/node.dart';
10-
import 'package:node_io/node_io.dart';
10+
import 'package:node_io/src/file_system.dart';
11+
12+
export 'package:node_io/src/directory.dart';
13+
export 'package:node_io/src/file.dart';
1114

1215
// Node seems to support ANSI escapes on all terminals.
1316
//
@@ -18,4 +21,9 @@ external bool get supportsAnsiEscapes;
1821

1922
void printStderr(Object message) => process.stderr.write("$message\n");
2023

21-
FileSystem get fileSystem => nodeFileSystem;
24+
int get exitCode => process.exitCode;
25+
void set exitCode(int code) {
26+
process.exitCode = code;
27+
}
28+
29+
final FileSystem fileSystem = NodeFileSystem();

lib/src/io/vm.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
// license that can be found in the LICENSE file or at
55
// https://opensource.org/licenses/MIT.
66

7+
export 'dart:io' show File, Directory, exitCode;
8+
79
import 'dart:io';
810

911
import 'package:file/file.dart';

0 commit comments

Comments
 (0)