Fixes some bugs

This commit is contained in:
Thomas Forgione 2019-02-25 10:21:35 +01:00
父節點 101e6a14a6
當前提交 a2767ee117
沒有發現已知的金鑰在資料庫的簽署中
GPG 金鑰 ID: 203DAEA747F48F41
共有 2 個檔案被更改,包括 18 行新增1 行删除

9
assets/help.txt Normal file
查看文件

@ -0,0 +1,9 @@
gclone 0.1.0
Thomas Forgione <thomas@forgione.fr>
Easily clone a git repository in the right place
USAGE:
gclone <URL>
ARGS:
URL The url of the repository (can be HTTP, HTTPS or SSH)

查看文件

@ -6,7 +6,9 @@ use colored::*;
use gclone::git::{clone, parse_url, GCLONE_PATH};
use gclone::{first_arg, Cache, Result};
fn help() {}
fn help() {
print!(include_str!("../assets/help.txt"));
}
fn main_result() -> Result<()> {
// Parse args
@ -16,6 +18,12 @@ fn main_result() -> Result<()> {
return Ok(help());
}
let url = if url.ends_with(".git") {
&url[0..url.len() - 4]
} else {
&url
};
let (server, owner, repo) = parse_url(&url)?;
// Build path