admin: localimporter can make symlink instead of copying whole files
This commit is contained in:
parent
d81f068eba
commit
8ed23ddc7a
5 changed files with 63 additions and 24 deletions
|
@ -20,6 +20,7 @@ type Importer interface {
|
|||
Kind() string
|
||||
exists(filename string) bool
|
||||
toURL(filename string) string
|
||||
importFile(URI string, next func(string, string) (interface{}, error)) (interface{}, error)
|
||||
getFile(filename string, writer *bufio.Writer) error
|
||||
listDir(filename string) ([]string, error)
|
||||
}
|
||||
|
@ -83,10 +84,6 @@ func ImportFile(i Importer, URI string, next func(string, string) (interface{},
|
|||
if r, err := next(dest, URI); err == nil {
|
||||
return r, err
|
||||
}
|
||||
|
||||
if err := os.Remove(dest); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure no more file is registered with this path
|
||||
|
|
Reference in a new issue