summaryrefslogtreecommitdiffstats
path: root/update.sh
diff options
context:
space:
mode:
authorCole Mickens <cole.mickens@gmail.com>2018-10-27 04:36:25 -0700
committerCole Mickens <cole.mickens@gmail.com>2018-10-27 04:38:18 -0700
commit5b19cdafd3ec59e1124894275909e5ed79d4389a (patch)
treed1a844676921b5e897167771d48cc32b1456e59b /update.sh
parent4ca7494e01d46ce6c437f33def6a9a5a8e1f233d (diff)
README.md: add lastrun info
Diffstat (limited to 'update.sh')
-rwxr-xr-xupdate.sh12
1 files changed, 8 insertions, 4 deletions
diff --git a/update.sh b/update.sh
index 6f58b8e..b67b65e 100755
--- a/update.sh
+++ b/update.sh
@@ -18,8 +18,8 @@ function update() {
rev=""
commitdate=""
url="https://api.github.com/repos/${owner}/${repo}/commits?sha=${ref}"
- #commit="$(curl --silent --fail "${url}")"
- commit="$(curl -u "${GHUSER}:${GHPASS}" --silent --fail "${url}")"
+ commit="$(curl --silent --fail "${url}")"
+ #commit="$(curl -u "${GHUSER}:${GHPASS}" --silent --fail "${url}")"
rev="$(echo "${commit}" | jq -r ".[0].sha")"
commitdate="$(echo "${commit}" | jq -r ".[0].commit.committer.date")"
sha256="$(nix-prefetch-url --unpack "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz" 2>/dev/null)"
@@ -72,8 +72,12 @@ rg \
--multiline '(?s)(.*)<!--pkgs-->(.*)<!--pkgs-->(.*)' \
"README.md" \
--replace "\$1${replace}\$3" \
- > README2.md
-mv README2.md README.md
+ > README2.md; mv README2.md README.md
+rg \
+ --multiline '(?s)(.*)<!--update-->(.*)<!--update-->(.*)' \
+ "README.md" \
+ --replace "\$1<!--update-->$(date '+%Y-%m-%d %H:%M')<!--update-->\$3" \
+ > README2.md; mv README2.md README.md
# optimisitically upload any "builtattrs" to our cache
copy="/etc/nixcfg/utils/azure/nix-copy-azure.sh"