feat(update): add update.sh
This commit is contained in:
parent
ba72023546
commit
e03a579a93
1 changed files with 20 additions and 0 deletions
20
packages/zen-browser-unwrapped/update.sh
Normal file
20
packages/zen-browser-unwrapped/update.sh
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p curl jq common-updater-scripts
|
||||
|
||||
set -eou pipefail
|
||||
|
||||
PACKAGE_PATH=./pkgs/by-name/ze/zen-browser-unwrapped
|
||||
PACKAGE_NIX="$PACKAGE_PATH"/package.nix
|
||||
|
||||
version="$(curl --silent 'https://api.github.com/repos/zen-browser/desktop/releases/latest' | jq --raw-output '.tag_name')"
|
||||
update-source-version zen-browser-unwrapped "${version}" --file="$PACKAGE_NIX"
|
||||
|
||||
# Get the extracted src for zen-browser, we need to read the `surfer.json` file
|
||||
# to get the Firefox version.
|
||||
src="$(nix-build -A zen-browser-unwrapped.src --no-out-link)"
|
||||
|
||||
# Get the Firefox version from the `surfer.json` file.
|
||||
firefoxVersion=$(cat "$src"/surfer.json | jq --raw-output '.version.version')
|
||||
|
||||
# Update the Firefox version for the derivation.
|
||||
update-source-version zen-browser-unwrapped "$firefoxVersion" --version-key=firefoxVersion --source-key=firefoxSrc --file="$PACKAGE_NIX"
|
||||
Loading…
Add table
Add a link
Reference in a new issue