Skip to content

Commit

Permalink
Try to fix version string patching on GitHub
Browse files Browse the repository at this point in the history
  • Loading branch information
cschwan committed Apr 4, 2024
1 parent 41514a7 commit 708f58d
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions xtask/src/install_manpages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,13 @@ fn render_manpages(path: &Path, cmd: &clap::Command, version: &str) -> Result<()
impl Subcommand for Opts {
fn run(&self) -> Result<()> {
let cmd = pineappl_cli::Opts::command();
let version: String = cmd
let version = cmd
.get_version()
// UNWRAP: the command must have a version
.unwrap()
.strip_prefix('v')
// UNWRAP: the version string must start with a 'v'
.expect(&format!("version string should contain 'v': {:?}", cmd.get_version()))
.to_string();
.unwrap();

// TODO: why does the version string not start with a 'v' on GitHub?
let version = version.strip_prefix('v').unwrap_or(version).to_string();
let mut cmd = cmd.version(version.clone());

// this is needed so subcommands return the correct `bin_name`
Expand Down

0 comments on commit 708f58d

Please sign in to comment.