mirror of https://github.com/hak5/overseer.git
Add sync after mv (#23)
* ignore intellij project folder * fix comment spelling * add sync after mvmaster
parent
7516f44481
commit
bc46621374
|
@ -1,3 +1,4 @@
|
||||||
tmp
|
tmp
|
||||||
myapp*
|
myapp*
|
||||||
example/docker
|
example/docker
|
||||||
|
.idea
|
||||||
|
|
13
sys_posix.go
13
sys_posix.go
|
@ -26,9 +26,18 @@ func move(dst, src string) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
//HACK: we're shelling out to mv because linux
|
//HACK: we're shelling out to mv because linux
|
||||||
//throws errors when crossing device boundaryes.
|
//throws errors when crossing device boundaries.
|
||||||
//TODO see sys_posix_mv.go
|
//TODO see sys_posix_mv.go
|
||||||
return exec.Command("mv", src, dst).Run()
|
if err := exec.Command("mv", src, dst).Run(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Run sync to 'commit' the mv by clearing caches
|
||||||
|
return sync().Run()
|
||||||
|
}
|
||||||
|
|
||||||
|
func sync() *exec.Cmd {
|
||||||
|
return exec.Command("sync")
|
||||||
}
|
}
|
||||||
|
|
||||||
func chmod(f *os.File, perms os.FileMode) error {
|
func chmod(f *os.File, perms os.FileMode) error {
|
||||||
|
|
Loading…
Reference in New Issue