Skip to content

Commit 88407ed

Browse files
committed
Add Date/Publication to DESCRIPTION files
in the same format as CRAN does it. Fixes r-universe-org/help#620
1 parent eb31b14 commit 88407ed

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

entrypoint.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ if [ "${2}" ]; then
3030
echo "Resetting to $2"
3131
( cd ${REPO}; git fetch origin "$2"; git reset --hard "$2" )
3232
fi
33+
GIT_DATE=$(cd ${REPO}; TZ=UTC git show --quiet --date='format-local:%Y-%m-%d %H:%M:%S UTC' --format="%cd")
3334
echo "::endgroup::"
3435

3536
# Subdirectory containing the R package
@@ -185,6 +186,7 @@ echo "buildtools::replace_rmarkdown_engine()" > /tmp/vignettehack.R
185186
# Replace or add "Repository:" in DESCRIPTION
186187
if [ "${MY_UNIVERSE}" ]; then
187188
sed -n -e '/^Repository:/!p' -e "\$aRepository: ${MY_UNIVERSE}" -i "${DESCRIPTION}"
189+
echo "Date/Publication: ${GIT_DATE}" >> "${DESCRIPTION}"
188190
echo "RemoteUrl: ${1}" >> "${DESCRIPTION}"
189191
echo "RemoteRef: ${BRANCH}" >> "${DESCRIPTION}"
190192
echo "RemoteSha: ${2}" >> "${DESCRIPTION}"

0 commit comments

Comments
 (0)