Skip to content

Instantly share code, notes, and snippets.

@acdibble
Created January 15, 2022 22:26
Show Gist options
  • Save acdibble/6d4e99da370766cf0abf893984370b9e to your computer and use it in GitHub Desktop.
Save acdibble/6d4e99da370766cf0abf893984370b9e to your computer and use it in GitHub Desktop.
get latest rust nightly with rls
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