Skip to content

Commit

Permalink
chore: make fluvio version works when publishing (#4184)
Browse files Browse the repository at this point in the history
  • Loading branch information
fraidev authored Sep 14, 2024
1 parent 23eb0a9 commit dffe364
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions crates/fluvio/VERSION
4 changes: 2 additions & 2 deletions crates/fluvio/build.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
fn main() {
// Copy VERSION file. Do not fail e.g. when built via `cargo publish`
if let Ok(verpath) = std::fs::canonicalize("../../VERSION") {
if let Ok(verpath) = std::fs::canonicalize("./VERSION") {
if verpath.exists() {
println!("cargo:rerun-if-changed=../../VERSION");
println!("cargo:rerun-if-changed=./VERSION");
}
}
println!("cargo:rerun-if-changed=build.rs");
Expand Down
2 changes: 1 addition & 1 deletion crates/fluvio/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ use tracing::instrument;

/// The minimum VERSION of the Fluvio Platform that this client is compatible with.
const MINIMUM_PLATFORM_VERSION: &str = "0.9.0";
pub(crate) const VERSION: &str = include_str!("../../../VERSION");
pub(crate) const VERSION: &str = include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/VERSION"));

/// Creates a producer that sends records to the named topic
///
Expand Down

0 comments on commit dffe364

Please sign in to comment.