Add basic interactive overwrite strategy
Available options: - Do not copy - Overwrite dest - Copy source as dest.dist
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
package project
|
||||
|
||||
import (
|
||||
"log"
|
||||
"fmt"
|
||||
"net/url"
|
||||
"os"
|
||||
"strings"
|
||||
@ -51,7 +51,7 @@ func (f *GitFetcher) Fetch(url *url.URL) (billy.Filesystem, error) {
|
||||
url.Fragment = ""
|
||||
}
|
||||
|
||||
log.Printf("Cloning repository '%s'...", url.String())
|
||||
fmt.Printf("Cloning repository '%s'.\n", url.String())
|
||||
|
||||
repo, err := git.Clone(memory.NewStorage(), fs, &git.CloneOptions{
|
||||
URL: url.String(),
|
||||
@ -72,7 +72,7 @@ func (f *GitFetcher) Fetch(url *url.URL) (billy.Filesystem, error) {
|
||||
return nil, errors.Wrap(err, "could not retrieve worktree")
|
||||
}
|
||||
|
||||
log.Printf("Checking out branch '%s'...", branchName)
|
||||
fmt.Printf("Checking out branch '%s'.\n", branchName)
|
||||
|
||||
err = worktree.Checkout(&git.CheckoutOptions{
|
||||
Force: true,
|
||||
|
Reference in New Issue
Block a user