Skip to content

Commit

Permalink
change config file location
Browse files Browse the repository at this point in the history
  • Loading branch information
woensug-choi committed Jun 18, 2024
1 parent 3a5bf22 commit aed9530
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions gz_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,8 @@ if [ -f "$HOME/.gz/sim/8/gui.config" ]; then
fi

# save GZ_INSTALL_ROOT in a file
if [ -f "$HOME/$ROS_INSTALL_ROOT/config" ]; then
echo "GZ_INSTALL_ROOT=$GZ_INSTALL_ROOT" >> "$HOME/$ROS_INSTALL_ROOT/config"
if [ -f "$HOME/.ros2_jazzy_install_config" ]; then
echo "GZ_INSTALL_ROOT=$GZ_INSTALL_ROOT" >> "$HOME/.ros2_jazzy_install_config"
fi

# Download sentenv.sh
Expand Down
18 changes: 9 additions & 9 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ VIRTUAL_ENV_ROOT=${VIRTUAL_ENV_ROOT:-$VIRTUAL_ENV_ROOT_DEFAULT}
# If uninstall
if [ -n "$UNINSTALL_FLAG" ]; then
echo -e "\033[31mUninstall installation request found!\033[0m"
if [ -f "$HOME/$ROS_INSTALL_ROOT/config" ]; then
# shellcheck disable=SC1090
source "$HOME/$ROS_INSTALL_ROOT/config"
if [ -f "$HOME/.ros2_jazzy_install_config" ]; then
# shellcheck disable=SC1091
source "$HOME/.ros2_jazzy_install_config"
echo "⚠️ The following directories will be removed:"
[ -n "$ROS_INSTALL_ROOT" ] && [ -d "$HOME/$ROS_INSTALL_ROOT" ] && echo " - $HOME/$ROS_INSTALL_ROOT"
[ -n "$VIRTUAL_ENV_ROOT" ] && [ -d "$HOME/$VIRTUAL_ENV_ROOT" ] && echo " - $HOME/$VIRTUAL_ENV_ROOT"
Expand All @@ -107,7 +107,7 @@ if [ -n "$UNINSTALL_FLAG" ]; then
fi
fi
else
echo -e "\033[31m❌ Error: Configuration file not found at $HOME/$ROS_INSTALL_ROOT/config\033[0m"
echo -e "\033[31m❌ Error: Configuration file not found at $HOME/.ros2_jazzy_install_config\033[0m"
echo -e "it seems that the installation is not found. Please check the installation directory.\n"
exit 1
fi
Expand Down Expand Up @@ -566,12 +566,12 @@ echo -e "\033[34m### [6/6] Post Installation Configuration\033[0m"
printf '\033[34m%.0s=\033[0m' {1..75} && echo
# ------------------------------------------------------------------------------
# save JAZZY_RELEASE_TAG, VIRTUAL_ENV_ROOT, VIRTUAL_ENV_ROOT in a file
if [ -f config ]; then
rm config
if [ -f "$HOME/.ros2_jazzy_install_config" ]; then
rm "$HOME/.ros2_jazzy_install_config"
fi
echo "JAZZY_RELEASE_TAG=$JAZZY_RELEASE_TAG" > "$HOME/$ROS_INSTALL_ROOT/config"
echo "VIRTUAL_ENV_ROOT=$VIRTUAL_ENV_ROOT" >> "$HOME/$ROS_INSTALL_ROOT/config"
echo "ROS_INSTALL_ROOT=$ROS_INSTALL_ROOT" >> "$HOME/$ROS_INSTALL_ROOT/config"
echo "JAZZY_RELEASE_TAG=$JAZZY_RELEASE_TAG" > "$HOME/.ros2_jazzy_install_config"
echo "VIRTUAL_ENV_ROOT=$VIRTUAL_ENV_ROOT" >> "$HOME/.ros2_jazzy_install_config"
echo "ROS_INSTALL_ROOT=$ROS_INSTALL_ROOT" >> "$HOME/.ros2_jazzy_install_config"

# Download sentenv.sh
if [ -f setenv.sh ]; then
Expand Down

0 comments on commit aed9530

Please sign in to comment.