mirror of
https://github.com/osmarks/mycorrhiza.git
synced 2024-12-12 05:20:26 +00:00
Create directories when renaming hyphae
This commit is contained in:
parent
2add791ba9
commit
47bc6aa31c
@ -4,6 +4,8 @@ package history
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"sync"
|
||||
|
||||
"github.com/bouncepaw/mycorrhiza/util"
|
||||
@ -68,6 +70,7 @@ func (hop *HistoryOp) WithFilesRemoved(paths ...string) *HistoryOp {
|
||||
func (hop *HistoryOp) WithFilesRenamed(pairs map[string]string) *HistoryOp {
|
||||
for from, to := range pairs {
|
||||
if from != "" {
|
||||
os.MkdirAll(filepath.Dir(to), 0777)
|
||||
hop.gitop(append([]string{"mv"}, from, to)...)
|
||||
}
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit c21b47739bc149456acc205e2c5acfa4b9eeb9d7
|
||||
Subproject commit 2c0e43199ed28f7022a38463a0eec3af3ecb03c9
|
Loading…
Reference in New Issue
Block a user