diff --git a/lib/shared/modules/zsh.nix b/lib/shared/modules/zsh.nix index 6e784963..6b5b8bc3 100644 --- a/lib/shared/modules/zsh.nix +++ b/lib/shared/modules/zsh.nix @@ -11,10 +11,15 @@ clone() { repo_url="$1" - # TODO: work with Bitbucket and GitLab. + # TODO: make it work with multi-level URLS - e.g. https://gitlab.com/a/b/c/d.git - user_and_repo_name="''${repo_url#https://github.com/}" - user_and_repo_name="''${repo_url#git@github.com:}" + user_and_repo_name="''${repo_url}" + user_and_repo_name="''${user_and_repo_name#git@bitbucket.com:}" + user_and_repo_name="''${user_and_repo_name#git@github.com:}" + user_and_repo_name="''${user_and_repo_name#git@gitlab.com:}" + user_and_repo_name="''${user_and_repo_name#https://bitbucket.com/}" + user_and_repo_name="''${user_and_repo_name#https://github.com/}" + user_and_repo_name="''${user_and_repo_name#https://gitlab.com/}" if [[ "''${user_and_repo_name}" =~ / ]]; then user="''${user_and_repo_name%%/*}"