Compare commits
1 Commits
2381e522e7
...
706d539dc4
Author | SHA1 | Date | |
---|---|---|---|
706d539dc4 |
@ -32,7 +32,6 @@ func Clone(dir, url string) error {
|
||||
defer signal.Stop(sigIntCh)
|
||||
|
||||
errCh := make(chan error)
|
||||
waitCh := make(chan struct{})
|
||||
|
||||
go func() {
|
||||
if _, err := os.Stat(dir); os.IsNotExist(err) {
|
||||
@ -74,13 +73,9 @@ func Clone(dir, url string) error {
|
||||
} else {
|
||||
log.Debugf("git clone: %s already exists", dir)
|
||||
}
|
||||
|
||||
close(waitCh)
|
||||
}()
|
||||
|
||||
select {
|
||||
case <-waitCh:
|
||||
return nil
|
||||
case <-sigIntCh:
|
||||
fmt.Println() // NOTE(d1): newline after ^C
|
||||
if err := os.RemoveAll(dir); err != nil {
|
||||
|
Loading…
x
Reference in New Issue
Block a user