Skip to content

Commit

Permalink
Don't remove directory if exists, remove files in it instead
Browse files Browse the repository at this point in the history
This resolves an edge case where the original WORKDIR is at `/workspace`, and then we proceed to download a directory from Nucleus to `/workspace`. This will cause the directory to be delete and recreated, making the current directory a deleted directory. If the user is not aware of this behavior, they may assume they are in the true `/workspace` directory.
  • Loading branch information
j3soon committed Nov 21, 2024
1 parent 46c61d6 commit 4f7b8f7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/docker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ fi
if [ -n "$DOWNLOAD_SRC" ] || [ -n "$DOWNLOAD_DEST" ]; then
if [ -e "$DOWNLOAD_DEST" ]; then
echo "File exists at '$DOWNLOAD_DEST', deleting..."
rm -rf "$DOWNLOAD_DEST"
rm -rf "$DOWNLOAD_DEST/*"
rm -rf "$DOWNLOAD_DEST/.*"
fi
echo "Copying files from '$DOWNLOAD_SRC' to '$DOWNLOAD_DEST'..."
( cd /omnicli && ./omnicli copy "$DOWNLOAD_SRC" "$DOWNLOAD_DEST" )
Expand Down

0 comments on commit 4f7b8f7

Please sign in to comment.