chore: ci-update
All checks were successful
Update Nix Packages with nix-update / nix-update (push) Successful in 40m47s

This commit is contained in:
m3tm3re
2026-03-25 19:11:57 +01:00
parent 27eb412218
commit 6d8bcbb27b
6 changed files with 91 additions and 85 deletions

View File

@@ -1,9 +1,9 @@
#!/usr/bin/env bash
#!/usr/bin/env nix-shell
#!nix-shell --pure -i bash -p bash curl jq nix cacert git
set -euo pipefail
# Update openshell sources.json with the latest release from GitHub.
# Usage: ./update.sh
# Called automatically by: nix-update --update-script openshell
# Usage: ./update.sh (or via nix-update --update-script)
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
SOURCES_FILE="$SCRIPT_DIR/sources.json"
@@ -50,3 +50,14 @@ jq -n \
> "$SOURCES_FILE"
echo "Updated $SOURCES_FILE to $VERSION"
# Commit when running in CI or via nix-update
if [[ -d "$SCRIPT_DIR/../../.git" ]] || git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
NIXPKGS_ROOT=$(git -C "$SCRIPT_DIR" rev-parse --show-toplevel 2>/dev/null || true)
if [[ -n "$NIXPKGS_ROOT" && -n "$(git -C "$NIXPKGS_ROOT" status --porcelain "$SOURCES_FILE")" ]]; then
CLEAN_VERSION="${VERSION#v}"
git -C "$NIXPKGS_ROOT" add "$SOURCES_FILE"
git -C "$NIXPKGS_ROOT" commit -m "openshell: ${CURRENT_VERSION#v} -> ${CLEAN_VERSION}"
echo "Committed update to git"
fi
fi