Make repo optional
This commit is contained in:
parent
a261bfdd26
commit
04212dff1c
4 changed files with 28 additions and 13 deletions
|
|
@ -102,8 +102,11 @@ impl ConfigFile {
|
|||
return Ok(name.clone());
|
||||
}
|
||||
|
||||
if let Command::Server(ServerCommand { repo, .. }) = &args.command {
|
||||
if let Some(name) = repo.canonicalize()?.file_name() {
|
||||
if let Command::Server(ServerCommand {
|
||||
repo: Some(path), ..
|
||||
}) = &args.command
|
||||
{
|
||||
if let Some(name) = path.canonicalize()?.file_name() {
|
||||
let name = name.to_string_lossy();
|
||||
let name = name.strip_suffix(".git").unwrap_or(&name).to_string();
|
||||
return Ok(name);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue