In CLI, get tree-sitter binding version from CLI's Cargo.toml

This commit is contained in:
Max Brunsfeld 2021-09-03 13:54:47 -07:00
parent 23b28f6f36
commit b938486ebe
2 changed files with 8 additions and 8 deletions

View file

@ -41,28 +41,28 @@ webbrowser = "0.5.1"
which = "4.1.0"
[dependencies.tree-sitter]
version = ">= 0.17.0"
version = "0.20"
path = "../lib"
[dev-dependencies.tree-sitter]
version = ">= 0.17.0"
version = "0.20"
path = "../lib"
features = ["allocation-tracking"]
[dependencies.tree-sitter-config]
version = ">= 0.19.0"
version = "0.19.0"
path = "config"
[dependencies.tree-sitter-highlight]
version = ">= 0.3.0"
version = "0.20"
path = "../highlight"
[dependencies.tree-sitter-loader]
version = ">= 0.19.0"
version = "0.19.0"
path = "loader"
[dependencies.tree-sitter-tags]
version = ">= 0.1.0"
version = "0.20"
path = "../tags"
[dependencies.serde_json]

View file

@ -82,10 +82,10 @@ fn read_git_sha() -> Option<String> {
}
fn read_rust_binding_version() -> String {
let path = "../lib/Cargo.toml";
let path = "Cargo.toml";
let text = fs::read_to_string(path).unwrap();
let cargo_toml = toml::from_str::<toml::Value>(text.as_ref()).unwrap();
cargo_toml["package"]["version"]
cargo_toml["dependencies"]["tree-sitter"]["version"]
.as_str()
.unwrap()
.trim_matches('"')