feat: infer current working directory
This commit is contained in:
parent
c9f5f7d3ea
commit
30341b45ff
1 changed files with 6 additions and 2 deletions
|
@ -9,6 +9,7 @@ use semver::Version;
|
|||
use semver_bump_trait::SemverBump;
|
||||
use slog::{debug, info};
|
||||
use std::cmp::Ordering;
|
||||
use std::path::PathBuf;
|
||||
use std::str::FromStr;
|
||||
|
||||
use crate::tags::get_tag_map;
|
||||
|
@ -28,8 +29,11 @@ pub struct VersionCommand {
|
|||
impl VersionCommand {
|
||||
pub async fn run(&self, log: slog::Logger) -> Result<()> {
|
||||
// Figure out the path we're searching and which one we found.
|
||||
let current_dir = &self.directory.clone();
|
||||
let current_dir = current_dir.as_ref().unwrap();
|
||||
let current_dir = match &self.directory {
|
||||
Some(current_dir) => PathBuf::from(current_dir.to_owned()),
|
||||
None => std::env::current_dir()?,
|
||||
};
|
||||
|
||||
info!(log, "searching from {:?}", current_dir);
|
||||
|
||||
// Load the repository so we can walk through it.
|
||||
|
|
Loading…
Reference in a new issue