2021-09-22 17:34:34 +02:00
|
|
|
#!/usr/bin/env nix-shell
|
2022-01-28 18:14:03 +01:00
|
|
|
#!nix-shell -i bash -p common-updater-scripts curl jq yarn yarn2nix-moretea.yarn2nix
|
2021-09-22 17:34:34 +02:00
|
|
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
2022-01-28 18:14:03 +01:00
|
|
|
owner=kylon
|
|
|
|
repo=Sharedown
|
|
|
|
latestVersion=$(curl "https://api.github.com/repos/$owner/$repo/releases/latest" | jq -r '.tag_name')
|
|
|
|
currentVersion=$(nix-instantiate --eval --expr 'with import ./. {}; sharedown.version' | tr -d '"')
|
|
|
|
|
|
|
|
if [[ "$currentVersion" == "$latestVersion" && "${BUMP_LOCK-}" != "1" ]]; then
|
|
|
|
# Skip update when already on the latest version.
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
update-source-version sharedown "$latestVersion"
|
2021-11-25 19:55:23 +01:00
|
|
|
|
2021-09-22 17:34:34 +02:00
|
|
|
dirname="$(realpath "$(dirname "$0")")"
|
|
|
|
sourceDir="$(nix-build -A sharedown.src --no-out-link)"
|
|
|
|
tempDir="$(mktemp -d)"
|
|
|
|
|
|
|
|
cp -r "$sourceDir"/* "$tempDir"
|
|
|
|
cd "$tempDir"
|
|
|
|
PUPPETEER_SKIP_DOWNLOAD=1 yarn install
|
|
|
|
yarn2nix > "$dirname/yarndeps.nix"
|
|
|
|
cp -r yarn.lock "$dirname"
|