forked from NixOS/nixpkgs
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
matrix-appservice-irc: add update script
- Loading branch information
1 parent
6a18a9a
commit df7232c
Showing
2 changed files
with
25 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
24 changes: 24 additions & 0 deletions
24
pkgs/servers/matrix-synapse/matrix-appservice-irc/update.sh
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 bash -p nodePackages.node2nix nodejs-12_x curl jq | ||
|
||
set -euo pipefail | ||
# cd to the folder containing this script | ||
cd "$(dirname "$0")" | ||
|
||
CURRENT_VERSION=$(nix eval --raw '(with import ../../../../. {}; matrix-appservice-irc.version)') | ||
TARGET_VERSION="$(curl https://api.github.com/repos/matrix-org/matrix-appservice-irc/releases/latest | jq -r ".tag_name")" | ||
|
||
if [[ "$CURRENT_VERSION" == "$TARGET_VERSION" ]]; then | ||
echo "matrix-appservice-irc is up-to-date: ${CURRENT_VERSION}" | ||
exit 0 | ||
fi | ||
|
||
echo "matrix-appservice-irc: $CURRENT_VERSION -> $TARGET_VERSION" | ||
|
||
sed -i "s/#$CURRENT_VERSION/#$TARGET_VERSION/" package.json | ||
|
||
./generate-dependencies.sh | ||
|
||
# Apparently this is done by r-ryantm, so only uncomment for manual usage | ||
#git add ./package.json ./node-packages.nix | ||
#git commit -m "matrix-appservice-irc: ${CURRENT_VERSION} -> ${TARGET_VERSION}" |