From 34c0a524553ca18b55f45933169001037ea67eb7 Mon Sep 17 00:00:00 2001 From: Federico Terzi Date: Mon, 22 Jun 2020 18:31:30 +0200 Subject: [PATCH] Remove trailing .git from repository url. Fix #326 --- src/main.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 5f394df..90cdbcd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1027,7 +1027,13 @@ fn install_main(_config_set: ConfigSet, matches: &ArgMatches) { exit(1); }); - let repository = matches.value_of("repository_url").unwrap_or("hub"); + let mut repository = matches.value_of("repository_url").unwrap_or("hub"); + + // Remove trailing .git string if present + // See: https://github.com/federico-terzi/espanso/issues/326 + if repository.ends_with(".git") { + repository = repository.trim_end_matches(".git") + } let package_resolver = Box::new(ZipPackageResolver::new());