Skip to content

Commit 7acd332

Browse files
committed
Move scripts to aliases
1 parent 8a2125e commit 7acd332

6 files changed

+16
-3
lines changed

.aliases/.gitkeep

Whitespace-only changes.
File renamed without changes.

scripts/update-default-nix.sh .aliases/update-default-nix

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,27 @@
1-
#!/usr/bin/env bash
1+
#! /usr/bin/env nix-shell
2+
#! nix-shell -i bash -p nix gnused
23

4+
set -e
35

46
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
57
cd "$SCRIPTDIR/.."
68

79
output=$(nix flake metadata --json)
810

11+
escape_for_sed() {
12+
local string="$1"
13+
string="${string//\//\\/}"
14+
string="${string//\-/\\\-}"
15+
string="${string//\+/\\\+}"
16+
echo "$string"
17+
}
18+
919
for input in nixpkgs nixpkgs-unstable nixpkgs-master; do
1020
echo "Processing input: $input"
1121
rev=$(echo "$output" | jq -r ".locks.nodes[\"${input}\"].locked.rev")
1222
hash=$(echo "$output" | jq -r ".locks.nodes[\"${input}\"].locked.narHash")
23+
echo "Got ${input} original hash: $hash"
24+
hash=$(escape_for_sed "$hash")
1325
echo "Got ${input} rev: $rev"
1426
echo "Got ${input} hash: $hash"
1527
sed -i "s/rev = \".*\"; # ${input}-rev/rev = \"$rev\"; # ${input}-rev/g" ./default.nix

scripts/verify-default-nix.sh .aliases/verify-default-nix

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#!/usr/bin/env sh
1+
#! /usr/bin/env nix-shell
2+
#! nix-shell -i bash -p nix
23

34
set -e
45

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414

1515
- name: verify-default-nix.sh
1616
if: "!contains(github.event.head_commit.message, 'noci')"
17-
run: ./scripts/verify-default-nix.sh
17+
run: ./.aliases/verify-default-nix
1818

1919
test:
2020
name: ${{matrix.suite}}

0 commit comments

Comments
 (0)