mirror of
https://github.com/cheat/cheat.git
synced 2024-11-22 14:01:36 +01:00
ebd9ec6287
Stubs out an experimental "installer" that will help new users to quickly configure `cheat`.
25 lines
438 B
Go
25 lines
438 B
Go
package installer
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
"os/exec"
|
|
)
|
|
|
|
const cloneURL = "https://github.com/cheat/cheatsheets.git"
|
|
|
|
// Clone clones the community cheatsheets
|
|
func Clone(path string) error {
|
|
|
|
// perform the clone in a shell
|
|
cmd := exec.Command("git", "clone", cloneURL, path)
|
|
cmd.Stdout = os.Stdout
|
|
cmd.Stderr = os.Stderr
|
|
err := cmd.Run()
|
|
if err != nil {
|
|
return fmt.Errorf("failed to clone cheatsheets: %v", err)
|
|
}
|
|
|
|
return nil
|
|
}
|