Ensure that manage_virtualenv.sh runs from the repository root
Previously, if the script was executed from another
directory (particularly `build-support` itself), it would fail, but
leave behind an extra `venv` directory, which caused subsequent
problems with Pants.
Now, all the logic takes place from the repository root, eliminating
these issues.
@@ -99,6 +99,11 @@ EOF
}
+REPOSITORY_ROOT=$(git rev-parse --show-toplevel)
+readonly REPOSITORY_ROOT
+
+(
+ cd "${REPOSITORY_ROOT}"
case "${1:-help}" in
populate)
populate
@@ -114,3 +119,4 @@ case "${1:-help}" in
exit 1
;;
esac
+)
