Chromium Code Reviews| Index: utils/testrunner/pipeline_utils.dart |
| =================================================================== |
| --- utils/testrunner/pipeline_utils.dart (revision 13447) |
| +++ utils/testrunner/pipeline_utils.dart (working copy) |
| @@ -20,6 +20,23 @@ |
| '${p.filenameWithoutExtension}${suffix}'; |
| } |
| +/** |
| + * Given a file path [file], make it absolute if it is relative, |
| + * and return the result as a [Path]. |
| + */ |
| +Path getAbsolutePath(String file) { |
| + var p = new Path(file).canonicalize(); |
| + if (p.isAbsolute) { |
| + return p; |
| + } else { |
| + var cwd = new Path((new Directory.current()).path); |
| + return cwd.join(p); |
| + } |
| +} |
| + |
| +/** Get the directory that contains a [file]. */ |
| +String getDirectory(String file) => getAbsolutePath(file).directoryPath.toString(); |
|
Siggi Cherem (dart-lang)
2012/10/10 17:51:32
80 col
gram
2012/10/17 00:03:28
Done.
|
| + |
| /** Create a file [fileName] and populate it with [contents]. */ |
| void writeFile(String fileName, String contents) { |
| var file = new File(fileName); |