mirror of
https://github.com/System-End/hackatime.git
synced 2026-04-20 00:35:22 +00:00
Skip repo check if git isn't in path
This commit is contained in:
parent
6995c3a564
commit
c7f2d687b2
1 changed files with 3 additions and 0 deletions
|
|
@ -2,6 +2,9 @@ require "open3"
|
|||
|
||||
class GitRemote
|
||||
def self.check_remote_exists(repo_url)
|
||||
# only run check if git is installed and in path
|
||||
return true unless system("git --version")
|
||||
|
||||
safe_repo_url = URI.parse(repo_url).to_s.gsub(" ", "").gsub("'", "")
|
||||
Open3.capture2e("git", "ls-remote", safe_repo_url).last.success?
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue