Skip to content
Closed
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
16 changes: 13 additions & 3 deletions src/usr/local/buildpack/utils/linking.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ fi

${1} "\$@"
EOM
# make it writable for the owner and the group
chmod 775 "$FILE"
if [[ -O "$FILE" ]] && [ "$(stat --format '%a' "${FILE}")" -ne 775 ] ; then
# make it writable for the owner and the group only if we are the owner
chmod 775 "$FILE"
fi
}

# use this for simple symlink to /usr/local/bin
Expand All @@ -36,5 +38,13 @@ function link_wrapper () {
SOURCE=$SOURCE/${1}
fi
check_command "$SOURCE"
ln -sf "$SOURCE" "$TARGET"
cat > "$TARGET" <<- EOM
#!/bin/bash

${SOURCE} "\$@"
EOM
if [[ -O "$TARGET" ]] && [ "$(stat --format '%a' "${TARGET}")" -ne 775 ] ; then
# make it writable for the owner and the group only if we are the owner
chmod 775 "$TARGET"
fi
}