File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
packages/console_app/test Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 11import 'dart:async' ;
22import 'dart:io' ;
3+ import 'package:path/path.dart' as path;
34import 'package:test/test.dart' ;
45
56void main () {
@@ -66,10 +67,19 @@ Future<ProcessResult> runConsoleApp(String input) async {
6667 // Use relative path since working directory is console_app
6768 final scriptPath = 'bin/console_app.dart' ;
6869
70+ final currentDir = Directory .current.path;
71+
72+ // Determine the working directory for the console process:
73+ // - If already in 'console_app' directory, use current directory (null)
74+ // - Otherwise, use relative path to console_app from workspace root
75+ final workingDir = path.basename (currentDir) == 'console_app'
76+ ? null
77+ : path.join ('packages' , 'console_app' );
78+
6979 // Start the Dart process
7080 final process = await Process .start ('dart' , [
7181 scriptPath,
72- ], workingDirectory: Directory .current.path );
82+ ], workingDirectory: workingDir );
7383
7484 // Write input to stdin
7585 process.stdin.writeln (input);
You can’t perform that action at this time.
0 commit comments