Skip to content

Commit

Permalink
Merge pull request #243 from jaredbischof/master
Browse files Browse the repository at this point in the history
Fix bug in copying subset nodes and version update.
  • Loading branch information
jaredbischof committed Dec 16, 2014
2 parents 79dcdb4 + 039ae74 commit 3e494b6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.9.3
0.9.4
17 changes: 16 additions & 1 deletion shock-server/node/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,22 @@ func (node *Node) Update(params map[string]string, files FormFiles) (err error)
node.File.Size = n.File.Size
node.File.Checksum = n.File.Checksum
node.File.Format = n.File.Format
node.Type = "copy"

if n.Type == "subset" {
node.Subset = n.Subset
subsetIndexFile := n.Path() + "/" + n.Id + ".subset.idx"
// The subset index file is required for creating a copy of a subset node.
if _, err := os.Stat(subsetIndexFile); err == nil {
if _, cerr := util.CopyFile(subsetIndexFile, node.Path()+"/"+node.Id+".subset.idx"); cerr != nil {
return cerr
}
} else {
return err
}
node.Type = "subset"
} else {
node.Type = "copy"
}

// Copy node indexes
if _, copyIndex := params["copy_indexes"]; copyIndex && (len(n.Indexes) > 0) {
Expand Down

0 comments on commit 3e494b6

Please sign in to comment.