Skip to content

Commit 13a042d

Browse files
EnselicaDotInTheVoid
authored andcommitted
update.sh: Make user, repo, and branch easy to change
1 parent 2a2d484 commit 13a042d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

update.sh

+7-3
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@ pyjq() {
44
python3 -c "import json, sys; print(json.load(sys.stdin)${1})"
55
}
66

7-
curl -# https://raw.githubusercontent.com/rust-lang/rust/master/src/rustdoc-json-types/lib.rs | sed 's/rustc_data_structures::fx::/std::collections::/g' | sed 's/FxHashMap/HashMap/g' > src/lib.rs
7+
user="rust-lang"
8+
repo="rust"
9+
branch="master"
810

9-
curl -# https://raw.githubusercontent.com/rust-lang/rust/master/src/rustdoc-json-types/tests.rs > src/tests.rs
11+
curl -# https://raw.githubusercontent.com/${user}/${repo}/${branch}/src/rustdoc-json-types/lib.rs | sed 's/rustc_data_structures::fx::/std::collections::/g' | sed 's/FxHashMap/HashMap/g' > src/lib.rs
1012

11-
curl -# "https://api.github.com/repos/rust-lang/rust/commits?path=src/rustdoc-json-types/lib.rs" | pyjq '[0]["sha"]' > COMMIT.txt
13+
curl -# https://raw.githubusercontent.com/${user}/${repo}/${branch}/src/rustdoc-json-types/tests.rs > src/tests.rs
14+
15+
curl -# "https://api.github.com/repos/${user}/${repo}/commits?sha=${branch}&path=src/rustdoc-json-types/lib.rs" | pyjq '[0]["sha"]' > COMMIT.txt

0 commit comments

Comments
 (0)