mirror of
https://github.com/osmarks/mycorrhiza.git
synced 2025-11-12 21:43:02 +00:00
Create directories when renaming hyphae
This commit is contained in:
@@ -4,6 +4,8 @@ package history
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"os"
|
||||||
|
"path/filepath"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/bouncepaw/mycorrhiza/util"
|
"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 {
|
func (hop *HistoryOp) WithFilesRenamed(pairs map[string]string) *HistoryOp {
|
||||||
for from, to := range pairs {
|
for from, to := range pairs {
|
||||||
if from != "" {
|
if from != "" {
|
||||||
|
os.MkdirAll(filepath.Dir(to), 0777)
|
||||||
hop.gitop(append([]string{"mv"}, from, to)...)
|
hop.gitop(append([]string{"mv"}, from, to)...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Submodule metarrhiza updated: c21b47739b...2c0e43199e
Reference in New Issue
Block a user