Reference "$HOME" instead of "~" in PATH message (#1911)
Closes https://github.com/dart-lang/sdk/issues/33256
The details of variable expansion when setting the PATH variable are a
little hard to follow. `"$HOME"` should work in more places than `"~"`
diff --git a/lib/src/global_packages.dart b/lib/src/global_packages.dart
index a69d5c4..3b5d62d 100644
--- a/lib/src/global_packages.dart
+++ b/lib/src/global_packages.dart
@@ -802,8 +802,8 @@
var binDir = _binStubDir;
if (binDir.startsWith(Platform.environment['HOME'])) {
- binDir =
- p.join("~", p.relative(binDir, from: Platform.environment['HOME']));
+ binDir = p.join(
+ r'$HOME', p.relative(binDir, from: Platform.environment['HOME']));
}
log.warning("${log.yellow('Warning:')} Pub installs executables into "