File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,8 @@ flutter324.buildFlutterApplication {
9696 install -Dm644 ./assets/images/icon.png $out/share/pixmaps/flclash.png
9797 '' ;
9898
99+ passthru . updateScript = ./update.sh ;
100+
99101 meta = {
100102 description = "Multi-platform proxy client based on ClashMeta, simple and easy to use, open-source and ad-free" ;
101103 homepage = "https://github.com/chen08209/FlClash" ;
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env nix-shell
2+ #! nix-shell -I nixpkgs=./. -i bash -p curl gnused jq yq nix bash coreutils nix-update
3+
4+ set -eou pipefail
5+
6+ ROOT=" $( dirname " $( readlink -f " $0 " ) " ) "
7+
8+ latestTag=$( curl ${GITHUB_TOKEN: +-u " :$GITHUB_TOKEN " } -sL https://api.github.com/repos/chen08209/FlClash/releases/latest | jq --raw-output .tag_name)
9+ latestVersion=$( echo " $latestTag " | sed ' s/^v//' )
10+
11+ currentVersion=$( nix-instantiate --eval -E " with import ./. {}; flclash.version or (lib.getVersion flclash)" | tr -d ' "' )
12+
13+ if [[ " $currentVersion " == " $latestVersion " ]]; then
14+ echo " package is up-to-date: $currentVersion "
15+ exit 0
16+ fi
17+
18+ nix-update --subpackage libclash flclash
19+
20+ curl https://raw.githubusercontent.com/chen08209/FlClash/${latestTag} /pubspec.lock | yq . > $ROOT /pubspec.lock.json
You can’t perform that action at this time.
0 commit comments