1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2024-12-12 13:30:26 +00:00

Create directories when renaming hyphae

This commit is contained in:
bouncepaw 2020-10-03 17:51:19 +05:00
parent 2add791ba9
commit 47bc6aa31c
2 changed files with 4 additions and 1 deletions

View File

@ -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