fennel-ls/tools/util/git.fnl
2024-09-07 11:12:31 -04:00

13 lines
476 B
Fennel

(local {: sh} (require :tools.util.sh))
(fn clone [location url ?tag]
"Clones a git repository, given a location, url, and optional tag."
(assert location "Expected file location to clone git repository into.")
(assert url "Expected git repository url to clone.")
(if ?tag
(sh :git :clone :-c :advice.detachedHead=false :--depth=1 :--branch ?tag
url location)
(sh :git :clone :-c :advice.detachedHead=false :--depth=1 url location)))
{: clone}