Skip to content

Commit

Permalink
Invoke existing install script to install on path
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexBeattie42 committed Oct 7, 2024
1 parent 47544b7 commit cf7f293
Showing 1 changed file with 2 additions and 20 deletions.
22 changes: 2 additions & 20 deletions scripts/build/opensim-core-linux-build-script.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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

cd ~/opensim-core/bin && echo -e "yes" | ./opensim-install-command-line.sh

0 comments on commit cf7f293

Please sign in to comment.