Skip repo check if git isn't in path

This commit is contained in:
Max Wofford 2025-04-30 18:33:28 -04:00
parent 6995c3a564
commit c7f2d687b2

View file

@ -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