Skip to content

Commit dcc7616

Browse files
committed
remove a bunch of outdated commands
1 parent aed99a4 commit dcc7616

File tree

11 files changed

+98
-964
lines changed

11 files changed

+98
-964
lines changed

go.mod

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,9 @@ require (
1919
)
2020

2121
require (
22-
github.com/abiosoft/ishell/v2 v2.0.2
23-
github.com/abiosoft/readline v0.0.0-20180607040430-155bce2042db
2422
github.com/caddyserver/certmagic v0.25.2
2523
github.com/charmbracelet/ssh v0.0.0-20250826160808-ebfa259c7309
2624
github.com/charmbracelet/wish v1.4.7
27-
github.com/creack/pty v1.1.24
2825
github.com/fsnotify/fsnotify v1.9.0
2926
github.com/getsops/sops/v3 v3.12.1
3027
github.com/knadh/koanf/providers/confmap v1.0.0
@@ -64,7 +61,6 @@ require (
6461
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.55.0 // indirect
6562
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.55.0 // indirect
6663
github.com/ProtonMail/go-crypto v1.4.0 // indirect
67-
github.com/abiosoft/ishell v2.0.0+incompatible // indirect
6864
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be // indirect
6965
github.com/aws/aws-sdk-go-v2 v1.41.2 // indirect
7066
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.5 // indirect
@@ -100,22 +96,19 @@ require (
10096
github.com/charmbracelet/x/ansi v0.11.6 // indirect
10197
github.com/charmbracelet/x/cellbuf v0.0.15 // indirect
10298
github.com/charmbracelet/x/conpty v0.2.0 // indirect
103-
github.com/charmbracelet/x/errors v0.0.0-20260301003739-baafbde16d0a // indirect
10499
github.com/charmbracelet/x/term v0.2.2 // indirect
105100
github.com/charmbracelet/x/termios v0.1.1 // indirect
106101
github.com/clipperhouse/displaywidth v0.11.0 // indirect
107-
github.com/clipperhouse/stringish v0.1.1 // indirect
108102
github.com/clipperhouse/uax29/v2 v2.7.0 // indirect
109103
github.com/cloudflare/circl v1.6.3 // indirect
110104
github.com/cncf/xds/go v0.0.0-20260202195803-dba9d589def2 // indirect
111105
github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect
112-
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
106+
github.com/creack/pty v1.1.24 // indirect
113107
github.com/envoyproxy/go-control-plane/envoy v1.37.0 // indirect
114108
github.com/envoyproxy/protoc-gen-validate v1.3.3 // indirect
115109
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect
116110
github.com/fatih/color v1.18.0 // indirect
117111
github.com/felixge/httpsnoop v1.0.4 // indirect
118-
github.com/flynn-archive/go-shlex v0.0.0-20150515145356-3f9db97f8568 // indirect
119112
github.com/getsops/gopgagent v0.0.0-20241224165529-7044f28e491e // indirect
120113
github.com/go-jose/go-jose/v4 v4.1.3 // indirect
121114
github.com/go-logfmt/logfmt v0.6.1 // indirect
@@ -170,9 +163,7 @@ require (
170163
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
171164
github.com/pkg/errors v0.9.1 // indirect
172165
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
173-
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
174166
github.com/rivo/uniseg v0.4.7 // indirect
175-
github.com/rogpeppe/go-internal v1.14.1 // indirect
176167
github.com/russross/blackfriday/v2 v2.1.0 // indirect
177168
github.com/ryanuber/go-glob v1.0.0 // indirect
178169
github.com/sirupsen/logrus v1.9.4 // indirect
@@ -203,13 +194,11 @@ require (
203194
golang.org/x/text v0.34.0 // indirect
204195
golang.org/x/time v0.14.0 // indirect
205196
golang.org/x/tools v0.42.0 // indirect
206-
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect
207197
google.golang.org/api v0.269.0 // indirect
208198
google.golang.org/genproto v0.0.0-20260226221140-a57be14db171 // indirect
209199
google.golang.org/genproto/googleapis/api v0.0.0-20260226221140-a57be14db171 // indirect
210200
google.golang.org/genproto/googleapis/rpc v0.0.0-20260226221140-a57be14db171 // indirect
211201
google.golang.org/grpc v1.79.1 // indirect
212202
google.golang.org/protobuf v1.36.11 // indirect
213203
gopkg.in/ini.v1 v1.67.1 // indirect
214-
gopkg.in/yaml.v3 v3.0.1 // indirect
215204
)

go.sum

Lines changed: 15 additions & 313 deletions
Large diffs are not rendered by default.

internal/app/app.go

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ type DenoConfig struct {
3131
}
3232

3333
type CronJob struct {
34-
Description string `json:"description"`
35-
Schedule string `json:"schedule"`
36-
Args []string `json:"args"`
34+
Description string `json:"description"`
35+
Schedule string `json:"schedule,omitempty"`
36+
Name string `json:"name,omitempty"`
3737
}
3838

3939
type App struct {
@@ -48,11 +48,6 @@ type App struct {
4848

4949
func (me *App) Dir() string {
5050
dir := me.BaseDir
51-
if fi, err := os.Lstat(dir); err == nil && fi.Mode()&os.ModeSymlink != 0 {
52-
if root, err := os.Readlink(dir); err == nil {
53-
dir = filepath.Join(filepath.Dir(dir), root)
54-
}
55-
}
5651

5752
if me.Config.Root != "" {
5853
return filepath.Join(dir, me.Config.Root)
@@ -81,17 +76,6 @@ func (me *App) Dir() string {
8176
return dir
8277
}
8378

84-
func (me *App) DataDir() string {
85-
dir := filepath.Join(me.Dir(), "data")
86-
if fi, err := os.Lstat(dir); err == nil && fi.Mode()&os.ModeSymlink != 0 {
87-
if root, err := os.Readlink(dir); err == nil {
88-
dir = filepath.Join(filepath.Dir(dir), root)
89-
}
90-
}
91-
92-
return dir
93-
}
94-
9579
func LookupApps(rootDir string) ([]string, error) {
9680
entries, err := os.ReadDir(rootDir)
9781
if err != nil {

internal/cmd/crons.go

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@ import (
1717
)
1818

1919
type CronItem struct {
20-
App string `json:"app"`
21-
Args []string `json:"args"`
22-
Schedule string `json:"schedule"`
20+
App string `json:"app"`
21+
app.CronJob
2322
}
2423

2524
func NewCmdCrons() *cobra.Command {
@@ -54,9 +53,8 @@ func NewCmdCrons() *cobra.Command {
5453

5554
for _, job := range a.Config.Crons {
5655
crons = append(crons, CronItem{
57-
App: appname,
58-
Args: job.Args,
59-
Schedule: job.Schedule,
56+
App: appname,
57+
CronJob: job,
6058
})
6159
}
6260
}
@@ -97,13 +95,7 @@ func NewCmdCrons() *cobra.Command {
9795
for _, item := range crons {
9896
printer.AddField(item.Schedule)
9997
printer.AddField(item.App)
100-
args, err := json.Marshal(item.Args)
101-
if err != nil {
102-
cmd.PrintErrf("failed to marshal args for app %s: %v\n", item.App, err)
103-
return ExitError{1}
104-
}
105-
106-
printer.AddField(string(args))
98+
printer.AddField(item.Name)
10799

108100
printer.EndRow()
109101
}
@@ -158,18 +150,12 @@ func CronRunner(logger *slog.Logger) *cron.Cron {
158150
logger.Error("failed to load app", "app", appname, "error", err)
159151
continue
160152
}
161-
wk := worker.NewWorker(a, nil)
162-
163-
command, err := wk.Command(context.Background(), job.Args)
164-
if err != nil {
165-
logger.Error("failed to create command", "app", appname, "args", job.Args, "error", err)
166-
continue
167-
}
168153

169-
logger.Info("running cron job", "app", appname, "args", job.Args, "schedule", job.Schedule)
154+
logger.Info("running cron job", "app", appname, "name", job.Name, "schedule", job.Schedule)
170155
go func() {
171-
if err := command.Run(); err != nil {
172-
logger.Error("failed to run command", "app", appname, "args", job.Args, "error", err)
156+
wk := worker.NewWorker(a, nil)
157+
if err := wk.TriggerCron(context.Background(), job); err != nil {
158+
logger.Error("failed to run command", "app", appname, "name", job.Name, "error", err)
173159
}
174160
}()
175161
}

internal/cmd/git.go

Lines changed: 0 additions & 77 deletions
This file was deleted.

internal/cmd/link.go

Lines changed: 0 additions & 73 deletions
This file was deleted.

0 commit comments

Comments
 (0)