add missing link cleanup subcommand.
This commit is contained in:
@@ -25,7 +25,7 @@ func (m Media) Move(root string) error {
|
||||
}
|
||||
defer f.Close()
|
||||
|
||||
content := filepath.Join(root, "content", m.Hash[:2], m.Hash[2:]+m.Extension)
|
||||
content := m.Content(root)
|
||||
|
||||
if _, err := os.Stat(content); !os.IsNotExist(err) {
|
||||
return Dup{content}
|
||||
@@ -67,3 +67,8 @@ func (m Media) Move(root string) error {
|
||||
// return os.Symlink(rel, name)
|
||||
return os.Link(content, name)
|
||||
}
|
||||
|
||||
// Content returns the content-address path starting at root.
|
||||
func (m Media) Content(root string) string {
|
||||
return filepath.Join(root, "content", m.Hash[:2], m.Hash[2:]+m.Extension)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user