Skip to content

Commit

Permalink
if docker compose up is ran before configure.sh, it will create a dir…
Browse files Browse the repository at this point in the history
…ectory called user.config.json since docker is trying to mount that as a volume but it doesn't exist yet since configure.sh is what creates it. this would then block configure.sh from creating it by default, so it now checks if user.config.json is an empty directory and deletes it if so. (#143)
  • Loading branch information
jfkeller authored Nov 12, 2024
1 parent 6fd09ed commit bb9d5a8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ USER_CONFIG_JSON_DESTINATION=${SCRIPT_DIR}/simulation/isaac-sim/docker/user.conf

echo -e "${BOLDCYAN}1. Generating Default IsaacSim Config ($USER_CONFIG_JSON_DESTINATION)${ENDCOLOR}"

if [ -d $USER_CONFIG_JSON_DESTINATION ] && [ $(ls -A $USER_CONFIG_JSON_DESTINATION | wc -l) == 0 ]; then
# delete an empty directory with the same name as $USER_CONFIG_JSON_DESTINATION which gets created when
# docker compose up is run before this script. Doing this will create a directory name user.config.json because
# it is being mounted as a volume but it doesn't exist yet.
rm -rf $USER_CONFIG_JSON_DESTINATION
fi

if [ -f $USER_CONFIG_JSON_DESTINATION ]; then
echo -e "${YELLOW}WARNING: The file $USER_CONFIG_JSON_DESTINATION already exists.${ENDCOLOR}"
confirm_no "Do you want to reset it to the default? [y/N]" && cp $USER_CONFIG_JSON_SOURCE $USER_CONFIG_JSON_DESTINATION
Expand Down

0 comments on commit bb9d5a8

Please sign in to comment.