process trailing slash if any

This commit is contained in:
svlandeg 2020-09-10 17:39:52 +02:00
parent f1bc09c1e9
commit 08a831ce83

View File

@ -203,6 +203,10 @@ def get_checksum(path: Union[Path, str]) -> str:
msg.fail(f"Can't get checksum for {path}: not a file or directory", exits=1) msg.fail(f"Can't get checksum for {path}: not a file or directory", exits=1)
def _brol(path):
return str.encode(Path(path).read_text().replace("\r\n", "\n"))
@contextmanager @contextmanager
def show_validation_error( def show_validation_error(
file_path: Optional[Union[str, Path]] = None, file_path: Optional[Union[str, Path]] = None,
@ -360,5 +364,7 @@ def _from_http_to_git(repo):
repo = repo.replace(r"http://", r"https://") repo = repo.replace(r"http://", r"https://")
if repo.startswith(r"https://"): if repo.startswith(r"https://"):
repo = repo.replace("https://", "git@").replace("/", ":", 1) repo = repo.replace("https://", "git@").replace("/", ":", 1)
if repo.endswith("/"):
repo = repo[:-1]
repo = f"{repo}.git" repo = f"{repo}.git"
return repo return repo