| Index: runtime/bin/process_impl.dart
|
| ===================================================================
|
| --- runtime/bin/process_impl.dart (revision 2981)
|
| +++ runtime/bin/process_impl.dart (working copy)
|
| @@ -10,7 +10,9 @@
|
|
|
| class _Process implements Process {
|
|
|
| - _Process.start(String path, List<String> arguments) {
|
| + _Process.start(String path,
|
| + List<String> arguments,
|
| + [String workingDirectory]) {
|
| if (path is !String) {
|
| throw new ProcessException("Path is not a String: $path");
|
| }
|
| @@ -29,6 +31,12 @@
|
| _arguments[i] = arguments[i];
|
| }
|
|
|
| + if (workingDirectory is !String && workingDirectory !== null) {
|
| + throw new ProcessException(
|
| + "WorkingDirectory is not a String: $workingDirectory");
|
| + }
|
| + _workingDirectory = workingDirectory;
|
| +
|
| _in = new _Socket._internalReadOnly(); // stdout coming from process.
|
| _out = new _Socket._internalWriteOnly(); // stdin going to process.
|
| _err = new _Socket._internalReadOnly(); // stderr coming from process.
|
| @@ -51,8 +59,14 @@
|
|
|
| void start() {
|
| var status = new _ProcessStartStatus();
|
| - bool success = _start(
|
| - _path, _arguments, _in, _out, _err, _exitHandler, status);
|
| + bool success = _start(_path,
|
| + _arguments,
|
| + _workingDirectory,
|
| + _in,
|
| + _out,
|
| + _err,
|
| + _exitHandler,
|
| + status);
|
| if (!success) {
|
| close();
|
| if (_errorHandler !== null) {
|
| @@ -106,6 +120,7 @@
|
|
|
| bool _start(String path,
|
| List<String> arguments,
|
| + String workingDirectory,
|
| Socket input,
|
| Socket output,
|
| Socket error,
|
| @@ -187,6 +202,7 @@
|
|
|
| String _path;
|
| ObjectArray<String> _arguments;
|
| + String _workingDirectory;
|
| Socket _in;
|
| Socket _out;
|
| Socket _err;
|
|
|