Skip to content

Commit

Permalink
Use join() from package:path for Windows compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
evanweible-wf committed Aug 18, 2022
1 parent 242fce5 commit 7ed1cef
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/src/executable.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ final _runScriptPath = p.join(cacheDirPath, 'run.dart');

final _runScript = File(_runScriptPath);

const _configPath = 'tool/dart_dev/config.dart';
final _configPath = p.join('tool', 'dart_dev', 'config.dart');

const _oldDevDartPath = 'tool/dev.dart';
final _oldDevDartPath = p.join('tool', 'dev.dart');

final _relativeDevDartPath = p.relative(
p.absolute(_configPath),
Expand All @@ -42,7 +42,7 @@ Future<void> run(List<String> args) async {
final oldDevDartExists = File(_oldDevDartPath).existsSync();

if (!configExists) {
log.fine('No custom `tool/dart_dev/config.dart` file found; '
log.fine('No custom `$_configPath` file found; '
'using default config.');
}
if (oldDevDartExists) {
Expand Down Expand Up @@ -162,8 +162,7 @@ Future<void> runWithConfig(
config = configGetter();
} catch (error) {
stderr
..writeln(
'Invalid "tool/dart_dev/config.dart" in ${p.absolute(p.current)}')
..writeln('Invalid "$_configPath" in ${p.absolute(p.current)}')
..writeln()
..writeln('It should provide a `Map<String, DevTool> config;` getter,'
' but it either does not exist or threw unexpectedly:')
Expand Down

0 comments on commit 7ed1cef

Please sign in to comment.