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
18 changes: 9 additions & 9 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -165,21 +165,21 @@ function update_node_version() {
sed -Ei -e "s/(debian:)name-slim/\\1${variant}/" "${dockerfile}-tmp"
fi

if diff -q "${dockerfile}-tmp" "${dockerfile}" > /dev/null; then
echo "${dockerfile} is already up to date!"
else
if [ "${SKIP}" != true ]; then
sed -Ei -e 's/^(ENV YARN_VERSION)=.*/\1='"${yarnVersion}"'/' "${dockerfile}-tmp"
fi
echo "${dockerfile} updated!"
if [ "${SKIP}" != true ]; then
sed -Ei -e 's/^(ENV YARN_VERSION)=.*/\1='"${yarnVersion}"'/' "${dockerfile}-tmp"
fi

# Required for POSIX sed
if [ -f "${dockerfile}-tmp-e" ]; then
rm "${dockerfile}-tmp-e"
fi

mv -f "${dockerfile}-tmp" "${dockerfile}"
if cmp -s "${dockerfile}-tmp" "${dockerfile}"; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not too important in terms of functionality but out of curiosity what made you choose cmp over the more common diff here?

rm -f "${dockerfile}-tmp"
info "${dockerfile} already up to date."
else
mv -f "${dockerfile}-tmp" "${dockerfile}"
info "${dockerfile} updated."
fi
)
}

Expand Down