From 3ef083eecc777c58c63d39dd68d214c7ae366bb5 Mon Sep 17 00:00:00 2001 From: Michael Moss Date: Fri, 8 May 2026 02:51:24 -0700 Subject: [PATCH] Allow the Studio build script to be run outside the git checkout. PiperOrigin-RevId: 912421771 Change-Id: Ie355d2f59cd43166ab06aa49349d87a0f5f9151c --- src/experimental/studio/build.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/experimental/studio/build.sh b/src/experimental/studio/build.sh index 8b8b116b..59b521ca 100755 --- a/src/experimental/studio/build.sh +++ b/src/experimental/studio/build.sh @@ -51,7 +51,8 @@ if [[ "$explicit_action" == false ]]; then do_build=true fi -cd "$(git rev-parse --show-toplevel)" +GIT_ROOT="${GIT_ROOT:-$(git rev-parse --show-toplevel)}" +cd "${GIT_ROOT}" # Configure MuJoCo Studio if [[ "$do_configure" == true ]]; then @@ -97,8 +98,8 @@ if [[ "$do_build" == true ]]; then echo "Use the following command to run mujoco_studio" echo "" if [[ "${OS_NAME}" == "windows" ]]; then - echo " cd $(git rev-parse --show-toplevel)/build/bin && ./${build_type}/mujoco_studio.exe " + echo " cd ${GIT_ROOT}/build/bin && ./${build_type}/mujoco_studio.exe " else - echo " cd $(git rev-parse --show-toplevel)/build/bin && ./mujoco_studio " + echo " cd ${GIT_ROOT}/build/bin && ./mujoco_studio " fi fi