From a4d9ca8671292f9028db51748f4f028746d9bdef Mon Sep 17 00:00:00 2001 From: Nick White Date: Wed, 23 Feb 2022 12:56:36 +0000 Subject: rescribe: Add embedded support for getgbook, for linux only so far --- cmd/rescribe/gbook.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'cmd/rescribe/gbook.go') 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 -- cgit v1.2.1-24-ge1ad