#!/bin/bash

echo "Updating vscode version in ./home/applications/vscode/extensions.toml"
sed -i "s/^vscode_version = .*/vscode_version = \"$(echo ":lf .#" | nix repl <<< "inputs.nixpkgs.legacyPackages.x86_64-linux.pkgs.vscodium.version" | grep -oP '(?<=")[0-9]+\.[0-9]+\.[0-9]+' | grep -v '^$')\"/" ./home/applications/vscode/extensions.toml



echo "Updating extension versions in ./home/applications/vscode/extensions.toml"
cargo run --manifest-path ./scripts/nix4vscode/Cargo.toml -- ./home/applications/vscode/extensions.toml > ./home/applications/vscode/extensions.lock