Skip to content

Commit

Permalink
Fix RenameNode implementation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Neumann committed Nov 24, 2014
1 parent 4bd3046 commit 6c51be4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/monsti-daemon/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,10 @@ type RenameNodeArgs struct {

func (i *MonstiService) RenameNode(args *RenameNodeArgs, reply *int) error {
root := i.Settings.Monsti.GetSiteNodesPath(args.Site)
if err := os.MkdirAll(
filepath.Dir(filepath.Join(root, args.Target)), 0700); err != nil {
return fmt.Errorf("Can't create parent directory: %v", err)
}
if err := os.Rename(
filepath.Join(root, args.Source),
filepath.Join(root, args.Target)); err != nil {
Expand Down

0 comments on commit 6c51be4

Please sign in to comment.