Skip to content

Commit 4d560f8

Browse files
committed
Remove dependency on jq, use plain python3 instead
This change might seem silly, but if you have a new computer and have not had time to install `jq` yet, the dependency on `jq` is a slight annoyance. `python3` is much more likely to be installed already.
1 parent c3efbeb commit 4d560f8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

update.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
#!/bin/sh
22

3+
pyjq() {
4+
python3 -c "import json, sys; print(json.load(sys.stdin)${1})"
5+
}
6+
37
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
48

59
curl -# https://raw.githubusercontent.com/rust-lang/rust/master/src/rustdoc-json-types/tests.rs > src/tests.rs
610

7-
curl -# "https://api.github.com/repos/rust-lang/rust/commits?path=src/rustdoc-json-types/lib.rs" | jq -r ".[0].sha" > COMMIT.txt
11+
curl -# "https://api.github.com/repos/rust-lang/rust/commits?path=src/rustdoc-json-types/lib.rs" | pyjq '[0]["sha"]' > COMMIT.txt

0 commit comments

Comments
 (0)