forked from NixOS/nixpkgs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Sefa Eyeoglu <[email protected]>
- Loading branch information
1 parent
587aeb8
commit afda201
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env nix-shell | ||
#! nix-shell -I nixpkgs=../../.. -i bash -p curl jq common-updater-scripts prefetch-npm-deps nodejs | ||
set -eou pipefail | ||
|
||
tempDir=$(mktemp -d) | ||
|
||
ghTags=$(curl ${GITHUB_TOKEN:+" -u \":$GITHUB_TOKEN\""} "https://api.github.com/repos/Vendicated/Vencord/tags") | ||
latestTag=$(echo "$ghTags" | jq -r .[0].name) | ||
gitHash=$(echo "$ghTags" | jq -r .[0].commit.sha) | ||
|
||
pushd "$tempDir" | ||
curl "https://raw.githubusercontent.com/Vendicated/Vencord/$latestTag/package.json" -o package.json | ||
npm install --legacy-peer-deps -f | ||
|
||
npmDepsHash=$(prefetch-npm-deps ./package-lock.json) | ||
popd | ||
|
||
pushd ../../.. | ||
update-source-version vencord "${latestTag#v}" | ||
popd | ||
|
||
sed -E 's#\bgitHash = ".*?"#gitHash = "'"${gitHash:0:7}"'"#' -i default.nix | ||
sed -E 's#\bnpmDepsHash = ".*?"#npmDepsHash = "'"$npmDepsHash"'"#' -i default.nix | ||
cp "$tempDir/package-lock.json" package-lock.json |