Documentation
¶
Index ¶
- func CheckCache(path, name, commit_hash string) bool
- func Clone(host, user_repo string, depth bool)
- func CommitBranch(user_repo, branch string) (string, string, error)
- func Extract(source, target, destination string, strip int)
- func Get(name, commit, destination, c_url string) (string, error)
- func LatestCommit(user_repo string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckCache ¶
Checks the cache stored in the default cache directory for gigit.
CheckCache returns a boolean. If the cache exists, it returns true. If it doesn't exist, it returns false.
CheckCache requires path for the default cache path, name for the repository name, and commit hash.
func Clone ¶
Clone repositories using git instead.
This will automatically be used when gigit does not find the intended repository.
This is especially useful when you want to type "gigit user/repo" instead of "git clone https...". In simple terms, it is meant to clone a private repository. Set depth to true if you want using "--depth 1"
user_repo here refers to a string containing "user/repo", not "user" or "repo" only!
func Extract ¶
Extract downloaded repository.
Extract file .tar.gz as "source", then an output directory for the extracted contents of the .tar.gz file as "destination", and a specific directory/path inside the .tar.gz file to extract its contents as "target".
func Get ¶
Get is used to download the repository. Get requires the repository name and its commit and output path for downloaded repository and optionally, a custom url. Get returns url used to download repo as string and returns an error when an error occurs.
func LatestCommit ¶
This function will fetch the latest commit hash from the repository for the extractor's use. GetLatestCommit is only used when the user does not provide a specific commit hash.
Example: "nazhard/gigit"
Types ¶
This section is empty.