| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library fasta.environment_variable; | 5 library fasta.testing.environment_variable; |
| 6 | 6 |
| 7 import 'dart:async' show Future; | 7 import 'dart:async' show Future; |
| 8 | 8 |
| 9 import 'dart:io' show Directory, File, Platform; | 9 import 'dart:io' show Directory, File, Platform; |
| 10 | 10 |
| 11 import 'errors.dart' show inputError; | 11 import '../errors.dart' show inputError; |
| 12 | 12 |
| 13 class EnvironmentVariable { | 13 class EnvironmentVariable { |
| 14 final String name; | 14 final String name; |
| 15 | 15 |
| 16 final String what; | 16 final String what; |
| 17 | 17 |
| 18 const EnvironmentVariable(this.name, this.what); | 18 const EnvironmentVariable(this.name, this.what); |
| 19 | 19 |
| 20 Future<String> get value async { | 20 Future<String> get value async { |
| 21 String value = Platform.environment[name]; | 21 String value = Platform.environment[name]; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 null, | 63 null, |
| 64 null, | 64 null, |
| 65 "The environment variable '$name' has the value " | 65 "The environment variable '$name' has the value " |
| 66 "'$value', that isn't a directory. $what"); | 66 "'$value', that isn't a directory. $what"); |
| 67 } | 67 } |
| 68 } | 68 } |
| 69 | 69 |
| 70 Future<bool> fileExists(Uri base, String path) async { | 70 Future<bool> fileExists(Uri base, String path) async { |
| 71 return await new File.fromUri(base.resolve(path)).exists(); | 71 return await new File.fromUri(base.resolve(path)).exists(); |
| 72 } | 72 } |
| OLD | NEW |