Compare commits

...

4 commits
v1.0.1 ... main

8 changed files with 19 additions and 4 deletions

1
.gitignore vendored
View file

@ -1 +1,2 @@
debug.log debug.log
/bin

View file

@ -4,6 +4,15 @@ Quick tool to write gemtext posts for my gemlog.
=> gemini://travisshears.com/gemlog => gemini://travisshears.com/gemlog
## Install
Build and link. Remember to setup config file as well.
```shell
$ go build -o bin/gemlog
$ ln -s /Users/xxxxxxxx/_projects/gemlog-cli/bin/gemlog-cli ~/bin/gemlog
```
## Config setup ## Config setup
This app relys on a config file at `~/.config/gemlog-cli/config.yml` This app relys on a config file at `~/.config/gemlog-cli/config.yml`

5
build.sh Executable file
View file

@ -0,0 +1,5 @@
#!/bin/sh
set -e
go build -o ./bin/gemlog-cli

View file

@ -17,7 +17,7 @@ func genBasicAuthHeader(user, password string) string {
} }
func ListGemLogs(config *Config) ([]GemlogListEntry, error) { func ListGemLogs(config *Config) ([]GemlogListEntry, error) {
url := fmt.Sprintf("%s:%d/gemlog/_design/gemlog-cli/_view/list", config.CouchDB.Host, config.CouchDB.Port) url := fmt.Sprintf("%s:%d/gemlog/_design/gemlog-cli/_view/list?descending=true", config.CouchDB.Host, config.CouchDB.Port)
req, err := http.NewRequest("GET", url, nil) req, err := http.NewRequest("GET", url, nil)
if err != nil { if err != nil {
return nil, fmt.Errorf("failed to create request: %w", err) return nil, fmt.Errorf("failed to create request: %w", err)

View file

@ -118,7 +118,7 @@ func (m model) View() string {
return s return s
} }
var enableLogs bool = true var enableLogs bool = false
func Run(config *gemlog.Config) { func Run(config *gemlog.Config) {
if enableLogs { if enableLogs {

View file

@ -39,7 +39,7 @@ func (m EntryListPageModel) Update(msg tea.Msg, active bool, ctx *context) (Entr
m.cursor-- m.cursor--
} }
case "down", "j": case "down", "j":
if m.cursor < len(actions)-1 { if m.cursor < len(m.entries)-1 {
m.cursor++ m.cursor++
} }
case "left", "h": case "left", "h":

View file

@ -4,8 +4,8 @@ import (
"fmt" "fmt"
"os" "os"
config "git.travisshears.com/travisshears/gemlog-cli/internal/config"
ui "git.travisshears.com/travisshears/gemlog-cli/internal/ui" ui "git.travisshears.com/travisshears/gemlog-cli/internal/ui"
config "git.travisshears.com/travisshears/gemlog-cli/internal/ui/config"
) )
func main() { func main() {