From 47544b7e6a9f8e75b3ac2301b4fa4355fb3d40db Mon Sep 17 00:00:00 2001 From: AlexBeattie42 Date: Fri, 4 Oct 2024 16:01:37 +0300 Subject: [PATCH 1/2] Update setting PATH env for Linux build script --- .../build/opensim-core-linux-build-script.sh | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/scripts/build/opensim-core-linux-build-script.sh b/scripts/build/opensim-core-linux-build-script.sh index a5948e99cb..591ba22790 100644 --- a/scripts/build/opensim-core-linux-build-script.sh +++ b/scripts/build/opensim-core-linux-build-script.sh @@ -212,5 +212,23 @@ ctest --parallel $NUM_JOBS --output-on-failure echo "LOG: INSTALL OPENSIM-CORE..." cd ~/opensim-workspace/opensim-core-build cmake --install . -echo 'export PATH=~/opensim-core/bin:$PATH' >> ~/.bashrc -source ~/.bashrc +# Update the .bashrc path to include the opensim-core install directory +if [ -n "$BASH" ]; then + rcFile="$HOME/.bashrc" + prop="PATH" # export property to insert + val="~/opensim-core/bin:\$PATH" # the desired value + echo -e "Current script $0 running in bash." + echo -e "Updating shell env file: $rcFile" + # Check if the PATH variable exits and update it + if grep -q "^export $prop=" "$rcFile"; then + sed -i "s|^export $prop=.*|export $prop=$val|" "$rcFile" && + echo "[updated] export $prop=$val" + else + echo -e "export $prop=$val" >>"$rcFile" + echo "[inserted] export $prop=$val" + fi + source $rcFile +else + echo -e "Current shell is not bash. Please manually update your shell env file to add the opensim install to your path:" + echo -e "export PATH=~/opensim-core/bin:$PATH" +fi \ No newline at end of file From cf7f2937be91a7e75c81bb149e2476da8501de14 Mon Sep 17 00:00:00 2001 From: AlexBeattie42 Date: Mon, 7 Oct 2024 09:20:37 +0300 Subject: [PATCH 2/2] Invoke existing install script to install on path --- .../build/opensim-core-linux-build-script.sh | 22 ++----------------- 1 file changed, 2 insertions(+), 20 deletions(-) mode change 100644 => 100755 scripts/build/opensim-core-linux-build-script.sh diff --git a/scripts/build/opensim-core-linux-build-script.sh b/scripts/build/opensim-core-linux-build-script.sh old mode 100644 new mode 100755 index 591ba22790..8cbaedb254 --- a/scripts/build/opensim-core-linux-build-script.sh +++ b/scripts/build/opensim-core-linux-build-script.sh @@ -212,23 +212,5 @@ ctest --parallel $NUM_JOBS --output-on-failure echo "LOG: INSTALL OPENSIM-CORE..." cd ~/opensim-workspace/opensim-core-build cmake --install . -# Update the .bashrc path to include the opensim-core install directory -if [ -n "$BASH" ]; then - rcFile="$HOME/.bashrc" - prop="PATH" # export property to insert - val="~/opensim-core/bin:\$PATH" # the desired value - echo -e "Current script $0 running in bash." - echo -e "Updating shell env file: $rcFile" - # Check if the PATH variable exits and update it - if grep -q "^export $prop=" "$rcFile"; then - sed -i "s|^export $prop=.*|export $prop=$val|" "$rcFile" && - echo "[updated] export $prop=$val" - else - echo -e "export $prop=$val" >>"$rcFile" - echo "[inserted] export $prop=$val" - fi - source $rcFile -else - echo -e "Current shell is not bash. Please manually update your shell env file to add the opensim install to your path:" - echo -e "export PATH=~/opensim-core/bin:$PATH" -fi \ No newline at end of file + +cd ~/opensim-core/bin && echo -e "yes" | ./opensim-install-command-line.sh