summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2024-10-19 18:45:40 +0300
committerPaul Buetow <paul@buetow.org>2024-10-19 18:45:40 +0300
commitc072a8a06c9634948497f4ef5e69b832c80be195 (patch)
treee97d54e6da2fc3f8c6d627653bb4a19a5e887f70
parent3287dbc49f3a9df43b086da84516b7e0a9902707 (diff)
jo
-rw-r--r--internal/platforms/linkedin/linkedin.go4
-rw-r--r--internal/prompt/prompt.go7
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")
}