Skip to content

Commit

Permalink
Changed file attachment to relative path
Browse files Browse the repository at this point in the history
  • Loading branch information
cgxeiji committed Nov 4, 2018
1 parent f78993b commit 9861aec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scholar/cmd/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ func attach(entry *scholar.Entry, file string) {
}
fmt.Println("Copied", b, "bytes to", path)
// horrible placeholder
entry.File = path
entry.Attach(filename)

update(entry)
}
2 changes: 1 addition & 1 deletion scholar/cmd/open.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ TODO: if there is no file attached, the entry's metadata file is opened.
Run: func(cmd *cobra.Command, args []string) {
if entry := guiQuery(entryList(), strings.Join(args, " ")); entry != nil {
if entry.File != "" {
open(entry.File)
open(filepath.Join(libraryPath(), entry.GetKey(), entry.File))
} else if url, ok := entry.Optional["url"]; ok && url != "" {
open(url)
} else if url, ok := entry.Required["url"]; ok && url != "" {
Expand Down

0 comments on commit 9861aec

Please sign in to comment.