vencord: fix paths in update script

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
Sefa Eyeoglu 2024-02-15 18:25:59 +01:00
parent f979844051
commit df9f79bbea
No known key found for this signature in database
GPG key ID: E13DFD4B47127951

View file

@ -1,7 +1,9 @@
#!/usr/bin/env nix-shell #!/usr/bin/env nix-shell
#! nix-shell -I nixpkgs=../../.. -i bash -p curl jq common-updater-scripts prefetch-npm-deps nodejs #! nix-shell -i bash -p curl jq common-updater-scripts prefetch-npm-deps nodejs
set -eou pipefail set -eou pipefail
pkgDir="$(dirname "$(readlink -f "$0")")"
tempDir=$(mktemp -d) tempDir=$(mktemp -d)
ghTags=$(curl ${GITHUB_TOKEN:+" -u \":$GITHUB_TOKEN\""} "https://api.github.com/repos/Vendicated/Vencord/tags") ghTags=$(curl ${GITHUB_TOKEN:+" -u \":$GITHUB_TOKEN\""} "https://api.github.com/repos/Vendicated/Vencord/tags")
@ -15,10 +17,8 @@ npm install --legacy-peer-deps -f
npmDepsHash=$(prefetch-npm-deps ./package-lock.json) npmDepsHash=$(prefetch-npm-deps ./package-lock.json)
popd popd
pushd ../../..
update-source-version vencord "${latestTag#v}" update-source-version vencord "${latestTag#v}"
popd
sed -E 's#\bgitHash = ".*?"#gitHash = "'"${gitHash:0:7}"'"#' -i default.nix sed -E 's#\bgitHash = ".*?"#gitHash = "'"${gitHash:0:7}"'"#' -i "$pkgDir/default.nix"
sed -E 's#\bnpmDepsHash = ".*?"#npmDepsHash = "'"$npmDepsHash"'"#' -i default.nix sed -E 's#\bnpmDepsHash = ".*?"#npmDepsHash = "'"$npmDepsHash"'"#' -i "$pkgDir/default.nix"
cp "$tempDir/package-lock.json" package-lock.json cp "$tempDir/package-lock.json" "$pkgDir/package-lock.json"