Skip to content

Instantly share code, notes, and snippets.

@cadojo
Created October 3, 2024 02:22
Show Gist options
  • Save cadojo/4ccd8508f29d3c85bca5fd66c738545c to your computer and use it in GitHub Desktop.
Save cadojo/4ccd8508f29d3c85bca5fd66c738545c to your computer and use it in GitHub Desktop.
Check for commits in the General registry.
using Git
using TOML
commit_exists(hash::AbstractString) =
try
run(pipeline(git(["cat-file", "-t", hash]); stdout = devnull))
return true
catch e
@error "$e"
return false
end
function versions(package::AbstractString)
content = TOML.parsefile(
joinpath("General", string(uppercase(first(package))), package, "Versions.toml"),
)
return first.(values.(values(content)))
end
packages = (
"GeneralAstrodynamics",
"AstrodynamicalCalculations",
"AstrodynamicalModels",
"AstrodynamicalSolvers",
)
for package in packages
for commit in versions(package)
@assert commit_exists(commit)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment