Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Go install made possible #112

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ yay -S circumflex

```console
# Go
go run main.go
go install github.com/bensadeh/circumflex@latest
```

> [!IMPORTANT]
Expand Down
11 changes: 6 additions & 5 deletions bubble/bubble.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package bubble

import (
"clx/categories"
"clx/cli"
"fmt"
"os"

"clx/bubble/list"
"clx/favorites"
"clx/settings"
"github.com/bensadeh/circumflex/categories"
"github.com/bensadeh/circumflex/cli"

"github.com/bensadeh/circumflex/bubble/list"
"github.com/bensadeh/circumflex/favorites"
"github.com/bensadeh/circumflex/settings"

tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/lipgloss"
Expand Down
8 changes: 4 additions & 4 deletions bubble/list/defaultitem.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import (
"io"
"strings"

"clx/constants/nerdfonts"
"github.com/bensadeh/circumflex/constants/nerdfonts"

"clx/constants/category"
"clx/item"
"clx/syntax"
"github.com/bensadeh/circumflex/constants/category"
"github.com/bensadeh/circumflex/item"
"github.com/bensadeh/circumflex/syntax"

"github.com/nleeper/goment"

Expand Down
47 changes: 22 additions & 25 deletions bubble/list/list.go
Original file line number Diff line number Diff line change
@@ -1,37 +1,38 @@
package list

import (
"clx/categories"
_ "embed"
"fmt"
"io"
"strconv"
"strings"
"time"

"clx/app"
"github.com/bensadeh/circumflex/categories"

"github.com/bensadeh/circumflex/app"

"github.com/charmbracelet/bubbles/viewport"

"clx/reader"

"clx/browser"
"clx/bubble/list/message"
"clx/bubble/ranking"
"clx/cli"
"clx/constants/category"
"clx/favorites"
"clx/header"
"clx/help"
"clx/history"
"clx/hn"
"clx/hn/services/hybrid"
"clx/hn/services/mock"
"clx/item"
"clx/screen"
"clx/settings"
"clx/tree"
"clx/validator"
"github.com/bensadeh/circumflex/reader"

"github.com/bensadeh/circumflex/browser"
"github.com/bensadeh/circumflex/bubble/list/message"
"github.com/bensadeh/circumflex/bubble/ranking"
"github.com/bensadeh/circumflex/cli"
"github.com/bensadeh/circumflex/constants/category"
"github.com/bensadeh/circumflex/favorites"
"github.com/bensadeh/circumflex/header"
"github.com/bensadeh/circumflex/help"
"github.com/bensadeh/circumflex/history"
"github.com/bensadeh/circumflex/hn"
"github.com/bensadeh/circumflex/hn/services/hybrid"
"github.com/bensadeh/circumflex/hn/services/mock"
"github.com/bensadeh/circumflex/item"
"github.com/bensadeh/circumflex/screen"
"github.com/bensadeh/circumflex/settings"
"github.com/bensadeh/circumflex/tree"
"github.com/bensadeh/circumflex/validator"

"github.com/charmbracelet/bubbles/paginator"
"github.com/charmbracelet/bubbles/spinner"
Expand Down Expand Up @@ -802,8 +803,6 @@ func (m *Model) handleBrowsing(msg tea.Msg) tea.Cmd {
m.SetDisabledInput(true)
startSpinnerCmd := m.StartSpinner()

//m.categoryToDisplay = nextCat

changeCatCmd := func() tea.Msg {
return message.FetchAndChangeToCategory{Index: nextIndex, Category: nextCat, Cursor: m.cursor}
}
Expand All @@ -826,8 +825,6 @@ func (m *Model) handleBrowsing(msg tea.Msg) tea.Cmd {
m.SetDisabledInput(true)
startSpinnerCmd := m.StartSpinner()

//m.categoryToDisplay = prevCat

changeCatCmd := func() tea.Msg {
return message.FetchAndChangeToCategory{Index: prevIndex, Category: prevCat, Cursor: m.cursor}
}
Expand Down
3 changes: 2 additions & 1 deletion bubble/list/message/message.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package message

import (
"clx/item"
"time"

"github.com/bensadeh/circumflex/item"
)

type EditorFinishedMsg struct {
Expand Down
3 changes: 2 additions & 1 deletion categories/categories.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package categories

import (
"clx/constants/category"
"fmt"
"os"
"strings"

"github.com/bensadeh/circumflex/constants/category"
)

type Category string
Expand Down
4 changes: 2 additions & 2 deletions cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"strconv"
"strings"

"clx/constants/unicode"
"clx/settings"
"github.com/bensadeh/circumflex/constants/unicode"
"github.com/bensadeh/circumflex/settings"
)

func Less(input string, config *settings.Config) *exec.Cmd {
Expand Down
4 changes: 2 additions & 2 deletions cmd/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package cmd
import (
"strconv"

"clx/favorites"
"clx/hn/services/hybrid"
"github.com/bensadeh/circumflex/favorites"
"github.com/bensadeh/circumflex/hn/services/hybrid"

"github.com/spf13/cobra"
)
Expand Down
8 changes: 4 additions & 4 deletions cmd/article.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import (
"os"
"strconv"

"clx/less"
"clx/reader"
"github.com/bensadeh/circumflex/less"
"github.com/bensadeh/circumflex/reader"

"clx/hn/services/hybrid"
"github.com/bensadeh/circumflex/hn/services/hybrid"

"clx/cli"
"github.com/bensadeh/circumflex/cli"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/clear.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cmd

import (
"clx/history"
"github.com/bensadeh/circumflex/history"

"github.com/spf13/cobra"
)
Expand Down
10 changes: 5 additions & 5 deletions cmd/comments.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import (
"strconv"
"time"

"clx/less"
"github.com/bensadeh/circumflex/less"

"clx/hn/services/hybrid"
"github.com/bensadeh/circumflex/hn/services/hybrid"

"clx/cli"
"clx/screen"
"clx/tree"
"github.com/bensadeh/circumflex/cli"
"github.com/bensadeh/circumflex/screen"
"github.com/bensadeh/circumflex/tree"

"github.com/spf13/cobra"
)
Expand Down
20 changes: 10 additions & 10 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import (
"fmt"
"os"

"clx/categories"
"github.com/bensadeh/circumflex/categories"

"clx/app"
"clx/bubble"
"clx/cli"
"clx/indent"
"clx/less"
"clx/settings"
"github.com/bensadeh/circumflex/app"
"github.com/bensadeh/circumflex/bubble"
"github.com/bensadeh/circumflex/cli"
"github.com/bensadeh/circumflex/indent"
"github.com/bensadeh/circumflex/less"
"github.com/bensadeh/circumflex/settings"

"github.com/logrusorgru/aurora/v3"
"github.com/spf13/cobra"
Expand All @@ -33,7 +33,7 @@ var (

func Root() *cobra.Command {
rootCmd := &cobra.Command{
Use: "clx",
Use: "github.com/bensadeh/circumflex",
Short: "\n" + aurora.Magenta("circumflex").String() + " is a command line tool for browsing Hacker News in your terminal",
Version: app.Version,
Run: func(cmd *cobra.Command, args []string) {
Expand Down Expand Up @@ -126,7 +126,7 @@ func verifyLess(noLessVerify bool) {
if !isValid && currentLessVersion == "" {
flag := aurora.Bold("--no-less-verify").String()
lessCmd := aurora.Magenta("less").String()
clxCmd := aurora.Magenta("clx").String()
clxCmd := aurora.Magenta("github.com/bensadeh/circumflex").String()
lessVersion := aurora.Yellow("?").String()

fmt.Printf("Could not verify version of %s\n\n", lessCmd)
Expand All @@ -140,7 +140,7 @@ func verifyLess(noLessVerify bool) {
if !isValid {
flag := aurora.Bold("--no-less-verify").String()
lessCmd := aurora.Magenta("less").String()
clxCmd := aurora.Magenta("clx").String()
clxCmd := aurora.Magenta("github.com/bensadeh/circumflex").String()
lessVersion := aurora.Yellow(currentLessVersion).String()

fmt.Printf("Your version of %s is outdated\n\n", lessCmd)
Expand Down
6 changes: 3 additions & 3 deletions cmd/url.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import (
_ "embed"
"os"

"clx/less"
"clx/reader"
"github.com/bensadeh/circumflex/less"
"github.com/bensadeh/circumflex/reader"

"clx/cli"
"github.com/bensadeh/circumflex/cli"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package cmd
import (
"fmt"

"clx/app"
"github.com/bensadeh/circumflex/app"

"github.com/spf13/cobra"
)
Expand Down
4 changes: 2 additions & 2 deletions comment/comment.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package comment
import (
"strings"

"clx/settings"
"clx/syntax"
"github.com/bensadeh/circumflex/settings"
"github.com/bensadeh/circumflex/syntax"

"github.com/logrusorgru/aurora/v3"

Expand Down
4 changes: 2 additions & 2 deletions favorites/bfavorites.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"fmt"
"os"

"clx/file"
"clx/item"
"github.com/bensadeh/circumflex/file"
"github.com/bensadeh/circumflex/item"
)

type Favorites struct {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module clx
module github.com/bensadeh/circumflex

go 1.22

Expand Down
3 changes: 2 additions & 1 deletion header/header.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package header

import (
"clx/categories"
"fmt"
"strings"

"github.com/bensadeh/circumflex/categories"

"github.com/charmbracelet/lipgloss"
)

Expand Down
4 changes: 2 additions & 2 deletions help/help.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package help
import (
"strings"

"clx/constants/unicode"
"clx/info"
"github.com/bensadeh/circumflex/constants/unicode"
"github.com/bensadeh/circumflex/info"
"github.com/charmbracelet/lipgloss"
)

Expand Down
2 changes: 1 addition & 1 deletion history/history.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"os"
"path"

"clx/file"
"github.com/bensadeh/circumflex/file"
)

type History interface {
Expand Down
2 changes: 1 addition & 1 deletion hn/hn.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package hn

import "clx/item"
import "github.com/bensadeh/circumflex/item"

type Service interface {
FetchItems(itemsToFetch int, category int) (items []*item.Item, errMsg string)
Expand Down
10 changes: 5 additions & 5 deletions hn/services/hybrid/hybrid.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import (

"github.com/bobesa/go-domain-util/domainutil"

ansi "clx/utils/strip-ansi"
ansi "github.com/bensadeh/circumflex/utils/strip-ansi"

"clx/app"
"clx/constants/category"
"clx/endpoints"
"clx/item"
"github.com/bensadeh/circumflex/app"
"github.com/bensadeh/circumflex/constants/category"
"github.com/bensadeh/circumflex/endpoints"
"github.com/bensadeh/circumflex/item"

"github.com/go-resty/resty/v2"
)
Expand Down
4 changes: 2 additions & 2 deletions hn/services/mock/mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"math/rand"
"time"

"clx/constants/category"
"clx/item"
"github.com/bensadeh/circumflex/constants/category"
"github.com/bensadeh/circumflex/item"
)

type Service struct{}
Expand Down
Loading