summaryrefslogtreecommitdiff
path: root/cmd/rescribe/gbook.go
diff options
context:
space:
mode:
authorNick White <git@njw.name>2022-02-23 12:56:36 +0000
committerNick White <git@njw.name>2022-02-23 12:56:36 +0000
commita4d9ca8671292f9028db51748f4f028746d9bdef (patch)
tree56f3bc34ea6cc7ca2a48f50e25c0ae8b736c0e1f /cmd/rescribe/gbook.go
parent2c29e91bd98a1354d0cc4772ca629e3f1fc327b5 (diff)
rescribe: Add embedded support for getgbook, for linux only so far
Diffstat (limited to 'cmd/rescribe/gbook.go')
-rw-r--r--cmd/rescribe/gbook.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/cmd/rescribe/gbook.go b/cmd/rescribe/gbook.go
index b1308cf..f0e9e1e 100644
--- a/cmd/rescribe/gbook.go
+++ b/cmd/rescribe/gbook.go
@@ -143,7 +143,7 @@ func moveFile(from string, to string) error {
// getGoogleBook downloads all images of a book to a directory
// named YEAR_AUTHORSURNAME_Title_bookid inside basedir, returning
// the directory path
-func getGoogleBook(ctx context.Context, id string, basedir string) (string, error) {
+func getGoogleBook(ctx context.Context, gbookcmd string, id string, basedir string) (string, error) {
author, title, year, err := getMetadata(id)
if err != nil {
return "", err
@@ -154,8 +154,7 @@ func getGoogleBook(ctx context.Context, id string, basedir string) (string, erro
return "", fmt.Errorf("Error setting up temporary directory: %v", err)
}
- // TODO: use embedded version if necessary
- cmd := exec.CommandContext(ctx, "getgbook", id)
+ cmd := exec.CommandContext(ctx, gbookcmd, id)
pipeline.HideCmd(cmd)
cmd.Dir = tmpdir
cmd.Stdout = os.Stdout