From c072a8a06c9634948497f4ef5e69b832c80be195 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 19 Oct 2024 18:45:40 +0300 Subject: jo --- internal/platforms/linkedin/linkedin.go | 4 +++- internal/prompt/prompt.go | 7 +++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/internal/platforms/linkedin/linkedin.go b/internal/platforms/linkedin/linkedin.go index b07ab70..c283fbc 100644 --- a/internal/platforms/linkedin/linkedin.go +++ b/internal/platforms/linkedin/linkedin.go @@ -58,7 +58,7 @@ func callLinkedInAPI(ctx context.Context, personID, accessToken, content string) post := map[string]interface{}{ "author": fmt.Sprintf("urn:li:person:%s", personID), - "commentary": content, // TODO: Can't post (...) paretenthesis? escape them? + "commentary": content, // TODO: Can't post (...) paretenthesis? escape them? TEST AGAIN! "visibility": "PUBLIC", "distribution": map[string]interface{}{ "feedDistribution": "MAIN_FEED", @@ -98,3 +98,5 @@ func callLinkedInAPI(ctx context.Context, personID, accessToken, content string) } return err } + +// TODO: Implement Gemini output? diff --git a/internal/prompt/prompt.go b/internal/prompt/prompt.go index bf5997d..6eecf60 100644 --- a/internal/prompt/prompt.go +++ b/internal/prompt/prompt.go @@ -46,8 +46,7 @@ func whatNow(question string) error { continue } - input = strings.TrimSpace(input) - switch strings.ToLower(input) { + switch strings.ToLower(strings.TrimSpace(input)) { case "y", "yes": return nil case "n", "no": @@ -61,8 +60,8 @@ func whatNow(question string) error { } func EditFile(filePath string) error { - editor := os.Getenv("EDITOR") - if editor == "" { + editor, ok := os.LookupEnv("EDITOR") + if !ok { return errors.New("EDITOR environment variable is not set") } -- cgit v1.2.3