gitdl

command module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 20, 2024 License: MIT Imports: 13 Imported by: 1

README

gitdl

git downloader for specific folder

cli:

you can run the cli with go run github.com/4lxprime/gitdl@main -h from anywhere on your system as long as you have go installed.

code:

if err := gitdl.DownloadGit(
    "torvalds/linux",   // base the clone on https://github.com/torvalds/linux
    "kernel",           // only clone the folder "kernel" from linux
    "linux_qernel",     // name the folder "linux_qernel"
    gitdl.WithBranch("master"),                             // base the clone on the master branch (default main)
    gitdl.WithExclusions("configs/*", "async.c"),           // exclude everything in configs/ and exclude async.c
    gitdl.WithReplace(gitdl.Map{"linux", "linuxisbetter"})  // everytime "linux" is mentionned, it will be remplaced by "linuxisbetter"
    gitdl.WithLogs,                                         // you want to enable log
    gitdl.WithAuth("ghp_*")                                 // use your github auth token so you can have likely unlimited requests
    gitdl.WithoutChecksum                                   // don't care about security (not recommended) 
); err != nil {
    log.Fatal(err)
}

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL