Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions internal/core/runner/python/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ copy_and_link() {
local src_file="$1"
local dest_file="$2"

# Check if src and dest are the same file (already linked or copied)
if [ -e "$dest_file" ]; then
# Compare inodes to check if they are the same file
src_inode=$(ls -i "$src_file" 2>/dev/null | awk '{print $1}')
dest_inode=$(ls -i "$dest_file" 2>/dev/null | awk '{print $1}')
if [ "$src_inode" = "$dest_inode" ]; then
# Already the same file, skip
return 0
fi
fi

if [ -L "$src_file" ]; then
# If src_file is a symbolic link, copy it without changing permissions
cp -P "$src_file" "$dest_file"
Expand Down