diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index 0a6034d..336a5f6 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -45,11 +45,12 @@ jobs: fetch-depth: 0 - uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5 with: - go-version: 1.22.3 + go-version-file: "go.mod" + - run: go version # Install dependencies - name: Install dependencies - run: go mod download + run: go get . # Get the version we're building - name: Get version diff --git a/Makefile b/Makefile index c0914fb..6e4ab1d 100644 --- a/Makefile +++ b/Makefile @@ -45,7 +45,7 @@ help: ## This help function @egrep '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' clean: ## Clean - rm -rf ./dist + rm -rf ./dist gollama*.zip gollama *.log debug-server: ## Debug server dlv debug --headless --api-version=2 --listen=127.0.0.1:43000 . @@ -63,7 +63,7 @@ test: ## Run test build: ## Run build $(eval GOLLAMA_VERSION := $(shell if [ -z "$(GOLLAMA_VERSION)" ]; then echo "dev"; else echo "$(GOLLAMA_VERSION)"; fi)) @echo "Building with version: $(GOLLAMA_VERSION)" - go build -v -ldflags "-X 'main.Version=$(GOLLAMA_VERSION)'" + go build -ldflags="-X 'main.Version=$(GOLLAMA_VERSION)'" @echo "Build completed, run ./gollama" ci: ## build for linux and macOS @@ -71,9 +71,9 @@ ci: ## build for linux and macOS @echo "Building with version: $(GOLLAMA_VERSION)" mkdir -p ./dist/macos ./dist/linux_amd64 ./dist/linux_arm64 - GOOS=darwin GOARCH=arm64 go build -v -ldflags="-X 'main.Version=$(GOLLAMA_VERSION)'" -o ./dist/macos/ - GOOS=linux GOARCH=amd64 go build -v -ldflags="-X 'main.Version=$(GOLLAMA_VERSION)'" -o ./dist/linux_amd64/ - GOOS=linux GOARCH=arm64 go build -v -ldflags="-X 'main.Version=$(GOLLAMA_VERSION)'" -o ./dist/linux_arm64/ + GOOS=darwin GOARCH=arm64 go build -ldflags="-X 'main.Version=$(GOLLAMA_VERSION)'" -o ./dist/macos/ + GOOS=linux GOARCH=amd64 go build -ldflags="-X 'main.Version=$(GOLLAMA_VERSION)'" -o ./dist/linux_amd64/ + GOOS=linux GOARCH=arm64 go build -ldflags="-X 'main.Version=$(GOLLAMA_VERSION)'" -o ./dist/linux_arm64/ # zip up each build zip -r gollama-macos.zip ./dist/macos/gollama diff --git a/app_model.go b/app_model.go index d59cac2..9e19b2a 100644 --- a/app_model.go +++ b/app_model.go @@ -386,9 +386,9 @@ func (m *AppModel) handleRunModelKey() (tea.Model, tea.Cmd) { func (m *AppModel) handleAltScreenKey() (tea.Model, tea.Cmd) { logging.DebugLogger.Println("AltScreen key matched") - m.altscreenActive = !m.altscreenActive + m.altScreenActive = !m.altScreenActive cmd := tea.EnterAltScreen - if !m.altscreenActive { + if !m.altScreenActive { cmd = tea.ExitAltScreen } return m, cmd diff --git a/go.sum b/go.sum index 9066164..7099aaa 100644 --- a/go.sum +++ b/go.sum @@ -6,8 +6,6 @@ github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiE github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= github.com/charmbracelet/bubbles v0.18.0 h1:PYv1A036luoBGroX6VWjQIE9Syf2Wby2oOl/39KLfy0= github.com/charmbracelet/bubbles v0.18.0/go.mod h1:08qhZhtIwzgrtBjAcJnij1t1H0ZRjwHyGsy6AL11PSw= -github.com/charmbracelet/bubbletea v0.26.4 h1:2gDkkzLZaTjMl/dQBpNVtnvcCxsh/FCkimep7FC9c40= -github.com/charmbracelet/bubbletea v0.26.4/go.mod h1:P+r+RRA5qtI1DOHNFn0otoNwB4rn+zNAzSj/EXz6xU0= github.com/charmbracelet/bubbletea v0.26.5 h1:90pqTPElAReb/qQUgSMUresTkfwVr0Wx+zczeHHOgxk= github.com/charmbracelet/bubbletea v0.26.5/go.mod h1:dz8CWPlfCCGLFbBlTY4N7bjLiyOGDJEnd2Muu7pOWhk= github.com/charmbracelet/harmonica v0.2.0 h1:8NxJWRWg/bzKqqEaaeFNipOu77YR5t8aSwG4pgaUBiQ= @@ -53,8 +51,6 @@ github.com/muesli/termenv v0.15.2 h1:GohcuySI0QmI3wN8Ok9PtKGkgkFIk7y6Vpb5PvrY+Wo github.com/muesli/termenv v0.15.2/go.mod h1:Epx+iuz8sNs7mNKhxzH4fWXGNpZwUaJKRS1noLXviQ8= github.com/natefinch/lumberjack v2.0.0+incompatible h1:4QJd3OLAMgj7ph+yZTuX13Ld4UpgHp07nNdFX7mqFfM= github.com/natefinch/lumberjack v2.0.0+incompatible/go.mod h1:Wi9p2TTF5DG5oU+6YfsmYQpsTIOm0B1VNzQg9Mw6nPk= -github.com/ollama/ollama v0.1.44 h1:3Htzf/mn0nNn1oBOm3rdnbSfX6dOTpOW0YRnxYTsqbo= -github.com/ollama/ollama v0.1.44/go.mod h1:TvVa25PEZI6M0bosiW1sa2XJGq3Xw/OPlpUAkMEntTU= github.com/ollama/ollama v0.1.45 h1:kwXM83GKToTnueX5zJHqRvwLy1/zzYw8C0sO60wOKqA= github.com/ollama/ollama v0.1.45/go.mod h1:TvVa25PEZI6M0bosiW1sa2XJGq3Xw/OPlpUAkMEntTU= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= diff --git a/main.go b/main.go index 44f592a..e5d7836 100644 --- a/main.go +++ b/main.go @@ -45,10 +45,9 @@ type AppModel struct { filterInput tea.Model showTop bool progress progress.Model - altscreenActive bool + altScreenActive bool view View showProgress bool - needsRefresh bool } type progressMsg struct { @@ -69,9 +68,7 @@ type genericMsg struct { message string } -var ( - Version string // Version will be set during the build process -) +var Version = "development" // Version is set by the build system func main() { cfg, err := config.LoadConfig() diff --git a/operations.go b/operations.go index c8b4b11..1374e90 100644 --- a/operations.go +++ b/operations.go @@ -27,6 +27,7 @@ func runModel(model string, cfg *config.Config) tea.Cmd { ollamaPath, err := exec.LookPath("ollama") if err != nil { logging.ErrorLogger.Printf("Error finding ollama binary: %v\n", err) + logging.ErrorLogger.Printf("If you're running Ollama in a container, make sure you updated the config file with the container name\n") return nil } c := exec.Command(ollamaPath, "run", model)