Fix error when trying to initialize a repository in an non-existent path

TG-1 #closed

Signed-off-by: trivernis <trivernis@protonmail.com>
pull/4/head
trivernis 3 years ago
parent 7f42804cc5
commit ff03b8a4ff

@ -67,11 +67,12 @@ enum SubCommand {
fn main() -> RepoResult<()> { fn main() -> RepoResult<()> {
let mut opt: Opt = Opt::from_args(); let mut opt: Opt = Opt::from_args();
opt.repo = env::current_dir() opt.repo = env::current_dir().unwrap().join(opt.repo);
.unwrap()
.join(opt.repo) if opt.repo.exists() {
.canonicalize() opt.repo = opt.repo.canonicalize().unwrap();
.unwrap(); }
let mut _guard = None; let mut _guard = None;
if opt.profile { if opt.profile {
_guard = Some(logging::init_tracing_flame()); _guard = Some(logging::init_tracing_flame());

Loading…
Cancel
Save