Created
January 15, 2022 22:26
-
-
Save acdibble/6d4e99da370766cf0abf893984370b9e to your computer and use it in GitHub Desktop.
get latest rust nightly with rls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const result = await fetch( | |
"https://raw.githubusercontent.com/rust-lang-nursery/rust-toolstate/master/history/linux.tsv", | |
); | |
const text = await result.text(); | |
const iterator = text.trimEnd().split("\n")[Symbol.iterator](); | |
iterator.next(); | |
for (const line of iterator) { | |
const [hash, json] = line.split(/\s+/); | |
const parsed = JSON.parse(json); | |
if (parsed.rls === "test-pass") { | |
const url = `https://api.github.com/repos/rust-lang/rust/commits/${hash}`; | |
const commitRes = await fetch(url); | |
const json = await commitRes.json(); | |
console.log(json.commit.author.date.split('T')[0]); | |
break; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment