10 Commits

Author SHA1 Message Date
4d3deaad32 go mod tidy
All checks were successful
CI / test (push) Successful in 2m12s
CI / build (push) Successful in 3m12s
2025-06-18 14:39:39 +02:00
d05ed50116 Setup goreleaser 2025-06-18 14:38:22 +02:00
0bd387caf7 Fetch after add
All checks were successful
CI / test (push) Successful in 1m1s
CI / build (push) Successful in 55s
2025-06-18 13:27:07 +02:00
0d027788f1 Differentiate billable/non-billable
All checks were successful
CI / test (push) Successful in 1m4s
CI / build (push) Successful in 58s
2025-06-18 13:20:33 +02:00
43845d28f1 All the deletes 2025-06-18 13:18:08 +02:00
eb61fdb757 DELETE first
All checks were successful
CI / test (push) Successful in 1m5s
CI / build (push) Successful in 1m2s
2025-06-18 13:13:13 +02:00
9cb0e7346b Upload others
All checks were successful
CI / test (push) Successful in 1m0s
CI / build (push) Successful in 59s
2025-06-18 13:02:28 +02:00
a9cd39e9e8 Fix package URL
All checks were successful
CI / test (push) Successful in 1m16s
CI / build (push) Successful in 1m1s
2025-06-18 12:55:30 +02:00
ddfbc89c5a Empty readme
All checks were successful
CI / test (push) Successful in 37s
CI / build (push) Successful in 2m26s
2025-06-18 12:50:53 +02:00
5d1c24cab7 OK can't bump that yet
All checks were successful
CI / test (push) Successful in 1m23s
CI / build (push) Successful in 4m4s
2025-06-18 12:43:08 +02:00
9 changed files with 99 additions and 23 deletions

View File

@@ -4,7 +4,7 @@ on: [push]
jobs: jobs:
test: test:
runs-on: ubuntu-24.10 runs-on: ubuntu-22.04
env: env:
RUNNER_TOOL_CACHE: /toolcache # Runner Tool Cache RUNNER_TOOL_CACHE: /toolcache # Runner Tool Cache
steps: steps:
@@ -43,7 +43,7 @@ jobs:
build: build:
needs: test needs: test
runs-on: ubuntu-24.10 runs-on: ubuntu-22.04
env: env:
RUNNER_TOOL_CACHE: /toolcache # Runner Tool Cache RUNNER_TOOL_CACHE: /toolcache # Runner Tool Cache
steps: steps:
@@ -83,11 +83,40 @@ jobs:
env: env:
GITEA_API_URL: https://code.ppl.town/api GITEA_API_URL: https://code.ppl.town/api
GITEA_TOKEN: ${{ secrets.PACKAGE_API_KEY }} GITEA_TOKEN: ${{ secrets.PACKAGE_API_KEY }}
REPOSITORY: charmite OWNER: justin
VERSION: 0.0.1 VERSION: 0.0.1
run: | run: |
curl -D- -s -X PUT "$GITEA_API_URL/packages/$REPOSITORY/generic/charmite/$VERSION/charmite_darwin_amd64" \ # charmite_darwin_amd64
curl -D- -s -X DELETE "$GITEA_API_URL/packages/$OWNER/generic/charmite/$VERSION/charmite_darwin_amd64" \
-H "Authorization: token $GITEA_TOKEN"
curl -D- -s -X PUT "$GITEA_API_URL/packages/$OWNER/generic/charmite/$VERSION/charmite_darwin_amd64" \
-H "Authorization: token $GITEA_TOKEN" \ -H "Authorization: token $GITEA_TOKEN" \
-H "Content-Type: application/octet-stream" \ -H "Content-Type: application/octet-stream" \
--data-binary @charmite_darwin_amd64 --data-binary @charmite_darwin_amd64
curl -D- -s -X DELETE "$GITEA_API_URL/packages/$OWNER/generic/charmite/$VERSION/charmite_darwin_arm64" \
-H "Authorization: token $GITEA_TOKEN"
curl -D- -s -X PUT "$GITEA_API_URL/packages/$OWNER/generic/charmite/$VERSION/charmite_darwin_arm64" \
-H "Authorization: token $GITEA_TOKEN" \
-H "Content-Type: application/octet-stream" \
--data-binary @charmite_darwin_arm64
curl -D- -s -X DELETE "$GITEA_API_URL/packages/$OWNER/generic/charmite/$VERSION/charmite_linux_amd64" \
-H "Authorization: token $GITEA_TOKEN"
curl -D- -s -X PUT "$GITEA_API_URL/packages/$OWNER/generic/charmite/$VERSION/charmite_linux_amd64" \
-H "Authorization: token $GITEA_TOKEN" \
-H "Content-Type: application/octet-stream" \
--data-binary @charmite_linux_amd64
curl -D- -s -X DELETE "$GITEA_API_URL/packages/$OWNER/generic/charmite/$VERSION/charmite_windows_amd64.exe" \
-H "Authorization: token $GITEA_TOKEN"
curl -D- -s -X PUT "$GITEA_API_URL/packages/$OWNER/generic/charmite/$VERSION/charmite_windows_amd64.exe" \
-H "Authorization: token $GITEA_TOKEN" \
-H "Content-Type: application/octet-stream" \
--data-binary @charmite_windows_amd64.exe

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
# Added by goreleaser init:
dist/

47
.goreleaser.yaml Normal file
View File

@@ -0,0 +1,47 @@
# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com
# The lines below are called `modelines`. See `:help modeline`
# Feel free to remove those if you don't want/need to use them.
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
version: 2
before:
hooks:
- go mod tidy
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
archives:
- formats: [tar.gz]
# this name template makes the OS and Arch compatible with the results of `uname`.
name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
# use zip for windows archives
format_overrides:
- goos: windows
formats: [zip]
gitea_urls:
api: https://code.ppl.town/api/v1
download: https://code.ppl.town
release:
footer: >-
---
Released by [GoReleaser](https://github.com/goreleaser/goreleaser).

6
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,6 @@
{
"cSpell.ignoreWords": [
"FORMENTRY",
"oday"
]
}

0
README.md Normal file
View File

8
go.mod
View File

@@ -2,10 +2,7 @@ module charmcal
go 1.24.1 go 1.24.1
require ( require github.com/charmbracelet/bubbles v0.21.0
github.com/charmbracelet/bubbles v0.21.0
github.com/stretchr/testify v1.10.0
)
require ( require (
github.com/atotto/clipboard v0.1.4 // indirect github.com/atotto/clipboard v0.1.4 // indirect
@@ -36,8 +33,5 @@ require (
github.com/charmbracelet/bubbletea v1.3.5 github.com/charmbracelet/bubbletea v1.3.5
github.com/charmbracelet/huh v0.7.0 github.com/charmbracelet/huh v0.7.0
github.com/charmbracelet/lipgloss v1.1.0 github.com/charmbracelet/lipgloss v1.1.0
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dustin/go-humanize v1.0.1 github.com/dustin/go-humanize v1.0.1
github.com/pmezard/go-difflib v1.0.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
) )

10
go.sum
View File

@@ -38,8 +38,6 @@ github.com/charmbracelet/x/xpty v0.1.2 h1:Pqmu4TEJ8KeA9uSkISKMU3f+C1F6OGBn8ABuGl
github.com/charmbracelet/x/xpty v0.1.2/go.mod h1:XK2Z0id5rtLWcpeNiMYBccNNBrP2IJnzHI0Lq13Xzq4= github.com/charmbracelet/x/xpty v0.1.2/go.mod h1:XK2Z0id5rtLWcpeNiMYBccNNBrP2IJnzHI0Lq13Xzq4=
github.com/creack/pty v1.1.24 h1:bJrF4RRfyJnbTJqzRLHzcGaZK1NeM5kTC9jGgovnR1s= github.com/creack/pty v1.1.24 h1:bJrF4RRfyJnbTJqzRLHzcGaZK1NeM5kTC9jGgovnR1s=
github.com/creack/pty v1.1.24/go.mod h1:08sCNb52WyoAwi2QDyzUCTgcvVFhUzewun7wtTfvcwE= github.com/creack/pty v1.1.24/go.mod h1:08sCNb52WyoAwi2QDyzUCTgcvVFhUzewun7wtTfvcwE=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f h1:Y/CXytFA4m6baUTXGLOoWe4PQhGxaX0KpnayAqC48p4= github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f h1:Y/CXytFA4m6baUTXGLOoWe4PQhGxaX0KpnayAqC48p4=
@@ -60,13 +58,9 @@ github.com/muesli/cancelreader v0.2.2 h1:3I4Kt4BQjOR54NavqnDogx/MIoWBFa0StPA8ELU
github.com/muesli/cancelreader v0.2.2/go.mod h1:3XuTXfFS2VjM+HTLZY9Ak0l6eUKfijIfMUZ4EgX0QYo= github.com/muesli/cancelreader v0.2.2/go.mod h1:3XuTXfFS2VjM+HTLZY9Ak0l6eUKfijIfMUZ4EgX0QYo=
github.com/muesli/termenv v0.16.0 h1:S5AlUN9dENB57rsbnkPyfdGuWIlkmzJjbFf0Tf5FWUc= github.com/muesli/termenv v0.16.0 h1:S5AlUN9dENB57rsbnkPyfdGuWIlkmzJjbFf0Tf5FWUc=
github.com/muesli/termenv v0.16.0/go.mod h1:ZRfOIKPFDYQoDFF4Olj7/QJbW60Ol/kL1pU3VfY/Cnk= github.com/muesli/termenv v0.16.0/go.mod h1:ZRfOIKPFDYQoDFF4Olj7/QJbW60Ol/kL1pU3VfY/Cnk=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no= github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no=
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM= github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM=
golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI= golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI=
@@ -79,7 +73,3 @@ golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20=
golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY=
golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

View File

@@ -129,8 +129,15 @@ type Service struct {
func (s Service) String() string { func (s Service) String() string {
return fmt.Sprintf("%d: %s", s.ID, s.Name) return fmt.Sprintf("%d: %s", s.ID, s.Name)
} }
func (s Service) GetID() int { return s.ID } func (s Service) GetID() int { return s.ID }
func (s Service) GetName() string { return s.Name } func (s Service) GetName() string {
prefix := "💰"
if !s.Billable {
prefix = "☮️"
}
return prefix + " " + s.Name
}
func (a APIClient) GetServices() (Services, error) { func (a APIClient) GetServices() (Services, error) {
// GET /services.json // GET /services.json

View File

@@ -48,6 +48,7 @@ func (m model) updateForm(msg tea.Msg) (tea.Model, tea.Cmd) {
} else { } else {
m.statusBarMessage = "Successfully logged time" m.statusBarMessage = "Successfully logged time"
m.tuiMode = MODE_CAL m.tuiMode = MODE_CAL
return m, m.fetchMiteData()
} }
} }