Skip to content

Commit c16b1df

Browse files
committed
make gitoxide publishable again
Apparently build scripts aren't executed when verifying a package, and this change should get past that.
1 parent ea9f942 commit c16b1df

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

Diff for: src/plumbing/main.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,9 @@ pub fn main() -> Result<()> {
149149
let mut engine = core::corpus::Engine::open_or_create(
150150
db,
151151
core::corpus::engine::State {
152-
gitoxide_version: env!("GITOXIDE_VERSION").into(),
152+
gitoxide_version: option_env!("GITOXIDE_VERSION")
153+
.ok_or_else(|| anyhow::anyhow!("GITOXIDE_VERSION must be set in build-script"))?
154+
.into(),
153155
progress,
154156
trace_to_progress: trace,
155157
reverse_trace_lines,

Diff for: src/plumbing/options/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use gitoxide_core as core;
44
use gix::bstr::BString;
55

66
#[derive(Debug, clap::Parser)]
7-
#[clap(name = "gix", about = "The git underworld", version = env!("GITOXIDE_VERSION"))]
7+
#[clap(name = "gix", about = "The git underworld", version = option_env!("GITOXIDE_VERSION"))]
88
#[clap(subcommand_required = true)]
99
#[clap(arg_required_else_help = true)]
1010
pub struct Args {

Diff for: src/porcelain/options.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::path::PathBuf;
22

33
#[derive(Debug, clap::Parser)]
4-
#[clap(about = "The rusty git", version = env!("GITOXIDE_VERSION"))]
4+
#[clap(about = "The rusty git", version = option_env!("GITOXIDE_VERSION"))]
55
#[clap(subcommand_required = true)]
66
pub struct Args {
77
/// Do not display verbose messages and progress information

0 commit comments

Comments
 (0)