Skip to content

Commit 6a27850

Browse files
authored
fix(env): version env (#578)
1 parent cf134f2 commit 6a27850

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

crates/pgt_env/src/lib.rs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,22 @@
88
use pgt_console::fmt::{Display, Formatter};
99
use pgt_console::{DebugDisplay, KeyValuePair, markup};
1010
use std::env;
11-
use std::sync::{LazyLock, OnceLock};
11+
use std::sync::OnceLock;
1212

1313
/// Returns `true` if this is an unstable build of Postgres Language Server
1414
pub fn is_unstable() -> bool {
1515
VERSION == "0.0.0"
1616
}
1717

18-
/// The internal version of Postgres Language Server. This is usually supplied during the CI build
19-
pub static PGLS_VERSION: LazyLock<Option<&str>> =
20-
LazyLock::new(|| option_env!("PGLS_VERSION").or(option_env!("PGT_VERSION")));
21-
22-
/// The version of Postgres Tools with fallback logic
23-
pub const VERSION: &str = match option_env!("PGT_VERSION") {
18+
/// The version of Postgres Language Server. This is usually supplied during the CI build.
19+
pub const VERSION: &str = match option_env!("PGLS_VERSION") {
2420
Some(version) => version,
25-
None => match option_env!("CARGO_PKG_VERSION") {
26-
Some(pkg_version) => pkg_version,
27-
None => "0.0.0",
21+
None => match option_env!("PGT_VERSION") {
22+
Some(version) => version,
23+
None => match option_env!("CARGO_PKG_VERSION") {
24+
Some(pkg_version) => pkg_version,
25+
None => "0.0.0",
26+
},
2827
},
2928
};
3029

0 commit comments

Comments
 (0)