Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions README.dev.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
## Development notes

The entrypoints for CLIs are:

```sh
cmd/gosuki/main.go
cmd/suki/suki.go
```

So to run via Go (and debug it)

```sh
go run ./cmd/gosuki
```

or

```sh
go run ./cmd/gosuki
```

## VSCodium/VSCode setup for running / debugging:

```sh
.vscode/launch.json
```

```json
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Debug gosuki import pocket",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceRoot}/cmd/gosuki",
"showLog": true,
// "debugAdapter": "dlv-dap",
"args": ["import", "pocket", "--debug=trace", "${workspaceRoot}/debug.csv"]
}
]
}
```

For MacOS:

```sh
.vscode/settings.json
```

```json
{
"go.goroot": "/opt/homebrew/Cellar/go/1.24.3/libexec"
}
```

Extensions:

- https://open-vsx.org/vscode/item?itemName=golang.Go
24 changes: 18 additions & 6 deletions cmd/pocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"errors"
"fmt"
"os"
"strconv"
"strings"

"github.com/urfave/cli/v3"
Expand Down Expand Up @@ -65,6 +66,10 @@
},
}

// CSV structure for Pocket import is:
//
// title,url,time_added,tags,status
// Opération Bobcat 1942-1946 - Tahiti Heritage,https://www.tahitiheritage.pf/operation-bobcat-1942-1946/,1689230329,history|military|polynesie|usa,unread
func importFromPocketCSV(ctx context.Context, c *cli.Command) error {
path := c.StringArg("path")
if c.StringArg("path") == "" {
Expand Down Expand Up @@ -113,14 +118,21 @@

title := row[0]
url := row[1]
// timeAdded := row[3]
tags := row[3]
title := row[0]

Check failure on line 121 in cmd/pocket.go

View workflow job for this annotation

GitHub Actions / build (amd64, darwin)

no new variables on left side of :=
timeAdded := row[2]
tags := row[4]

modified, err := strconv.ParseUint(string(timeAdded), 10, 64)
if err != nil {
panic(err)
}

bookmark := &gosuki.Bookmark{
URL: url,
Title: title,
Tags: strings.Split(tags, ","),
Module: PocketImporterID,
URL: url,
Title: title,
Tags: strings.Split(tags, "|"),
Module: PocketImporterID,
Modified: modified,
}

if err = DB.UpsertBookmark(bookmark); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/logging/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const (

var (
//RELEASE: Change to Release for release mode
LoggingMode = Release
LoggingMode = Dev
TUIMode bool
SilentMode bool
)
Expand Down
Loading