link: allow creating public link to files and folders - closes #1562

This commit is contained in:
Stefan 2018-03-29 09:10:19 +02:00 committed by GitHub
parent 9df266a6b4
commit a8267d1628
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
31 changed files with 275 additions and 41 deletions

View file

@ -141,10 +141,10 @@ func ShowVersion() {
fmt.Printf("- go version: %s\n", runtime.Version())
}
// newFsFile creates a dst Fs from a name but may point to a file.
// NewFsFile creates a dst Fs from a name but may point to a file.
//
// It returns a string with the file name if points to a file
func newFsFile(remote string) (fs.Fs, string) {
func NewFsFile(remote string) (fs.Fs, string) {
fsInfo, configName, fsPath, err := fs.ParseRemote(remote)
if err != nil {
fs.CountError(err)
@ -169,7 +169,7 @@ func newFsFile(remote string) (fs.Fs, string) {
//
// This can point to a file
func newFsSrc(remote string) (fs.Fs, string) {
f, fileName := newFsFile(remote)
f, fileName := NewFsFile(remote)
if fileName != "" {
if !filter.Active.InActive() {
err := errors.Errorf("Can't limit to single files when using filters: %v", remote)