Skip to content
This repository has been archived by the owner on Nov 2, 2018. It is now read-only.

Commit

Permalink
Merge pull request #825 from mtlynch/fix-sharedest
Browse files Browse the repository at this point in the history
Fix naming of sharedest to match standard naming conventions
  • Loading branch information
DavidVorick committed Oct 27, 2015
2 parents 55f3130 + 46229dd commit 187a044
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion modules/renter.go
Expand Up @@ -122,7 +122,7 @@ type Renter interface {
RenameFile(currentName, newName string) error

// ShareFiles creates a '.sia' file that can be shared with others.
ShareFiles(nicknames []string, sharedest string) error
ShareFiles(nicknames []string, shareDest string) error

// ShareFilesAscii creates an ASCII-encoded '.sia' file.
ShareFilesAscii(nicknames []string) (asciiSia string, err error)
Expand Down
10 changes: 5 additions & 5 deletions modules/renter/persist.go
Expand Up @@ -280,25 +280,25 @@ func (r *Renter) shareFiles(nicknames []string, w io.Writer) error {
return nil
}

// ShareFile saves the specified files to sharedest.
func (r *Renter) ShareFiles(nicknames []string, sharedest string) error {
// ShareFile saves the specified files to shareDest.
func (r *Renter) ShareFiles(nicknames []string, shareDest string) error {
lockID := r.mu.RLock()
defer r.mu.RUnlock(lockID)

// TODO: consider just appending the proper extension.
if filepath.Ext(sharedest) != ShareExtension {
if filepath.Ext(shareDest) != ShareExtension {
return ErrNonShareSuffix
}

file, err := os.Create(sharedest)
file, err := os.Create(shareDest)
if err != nil {
return err
}
defer file.Close()

err = r.shareFiles(nicknames, file)
if err != nil {
os.Remove(sharedest)
os.Remove(shareDest)
return err
}

Expand Down

0 comments on commit 187a044

Please sign in to comment.