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<()> {
let mut opt: Opt = Opt::from_args();
opt.repo = env::current_dir()
.unwrap()
.join(opt.repo)
.canonicalize()
.unwrap();
opt.repo = env::current_dir().unwrap().join(opt.repo);
if opt.repo.exists() {
opt.repo = opt.repo.canonicalize().unwrap();
}
let mut _guard = None;
if opt.profile {
_guard = Some(logging::init_tracing_flame());

Loading…
Cancel
Save