vscode-runner: Add update script

This commit is contained in:
PhiliPdB
2025-04-14 19:09:21 +02:00
parent f49d55c90e
commit 5c8189ad87
2 changed files with 37 additions and 2 deletions
+1 -2
View File
@@ -3,7 +3,6 @@
fetchFromGitHub,
buildDartApplication,
kdePackages,
nix-update-script,
}:
let
@@ -40,7 +39,7 @@ buildDartApplication {
$out/share/krunner/dbusplugins/plasma-runner-vscode_runner.desktop
'';
passthru.updateScript = nix-update-script { };
passthru.updateScript = ./update.sh;
meta = {
description = "KRunner plugin for quickly opening recent VSCode workspaces";
+36
View File
@@ -0,0 +1,36 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p yq ripgrep common-updater-scripts dart
set -xeu -o pipefail
PACKAGE_DIR="$(realpath "$(dirname "$0")")"
cd "$PACKAGE_DIR/.."
while ! test -f flake.nix; do cd ..; done
NIXPKGS_DIR="$PWD"
# Get latest version number from GitHub
version="$(
list-git-tags --url=https://github.com/Merrit/vscode-runner |
rg '^v(.*)' -r '$1' |
sort --version-sort |
tail -n1
)"
# Update to latest version
cd "$NIXPKGS_DIR"
update-source-version vscode-runner "$version"
# Create new pubspec.lock.json
TMPDIR="$(mktemp -d)"
cd "$TMPDIR"
src=$(nix-build --no-link "$NIXPKGS_DIR" -A vscode-runner.src)
cp $src/pubspec.* .
if ! test -f pubspec.lock; then
dart pub update
fi
yq . pubspec.lock > "$PACKAGE_DIR/pubspec.lock.json"
rm -rf "$TMPDIR"