this repo has no description smallweb.run
smallweb
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

remove support for stdin

+4 -27
+1 -1
internal/cmd/crons.go
··· 183 183 } 184 184 wk := worker.NewWorker(a, k.Bool(fmt.Sprintf("apps.%s.admin", a.Name)), nil) 185 185 186 - command, err := wk.Command(context.Background(), job.Args, nil) 186 + command, err := wk.Command(context.Background(), job.Args) 187 187 if err != nil { 188 188 logger.Error("failed to create command", "app", appname, "args", job.Args, "error", err) 189 189 continue
+1 -13
internal/cmd/run.go
··· 2 2 3 3 import ( 4 4 "fmt" 5 - "io" 6 - "os" 7 5 8 - "github.com/mattn/go-isatty" 9 6 "github.com/pomdtr/smallweb/internal/app" 10 7 "github.com/pomdtr/smallweb/internal/worker" 11 8 "github.com/spf13/cobra" ··· 38 35 } 39 36 40 37 wk := worker.NewWorker(a, k.Bool(fmt.Sprintf("apps.%s.admin", a.Name)), nil) 41 - var input []byte 42 - if !isatty.IsTerminal(os.Stdin.Fd()) { 43 - i, err := io.ReadAll(os.Stdin) 44 - if err != nil { 45 - return fmt.Errorf("failed to read from stdin: %w", err) 46 - } 47 - 48 - input = i 49 - } 50 - command, err := wk.Command(cmd.Context(), args[1:], input) 38 + command, err := wk.Command(cmd.Context(), args[1:]) 51 39 if err != nil { 52 40 return fmt.Errorf("failed to create command: %w", err) 53 41 }
+1 -11
internal/cmd/up.go
··· 315 315 } 316 316 317 317 wk := worker.NewWorker(a, k.Bool(fmt.Sprintf("apps.%s.admin", a.Name)), nil) 318 - var input []byte 319 - if !sess.EmulatedPty() { 320 - input, err = io.ReadAll(sess) 321 - if err != nil { 322 - fmt.Fprintf(sess, "failed to read input: %v\n", err) 323 - sess.Exit(1) 324 - return 325 - } 326 - } 327 - 328 - cmd, err := wk.Command(sess.Context(), sess.Command(), input) 318 + cmd, err := wk.Command(sess.Context(), sess.Command()) 329 319 if err != nil { 330 320 fmt.Fprintf(sess, "failed to get command: %v\n", err) 331 321 sess.Exit(1)
+1 -2
internal/worker/worker.go
··· 462 462 return "", fmt.Errorf("deno executable not found") 463 463 } 464 464 465 - func (me *Worker) Command(ctx context.Context, args []string, input []byte) (*exec.Cmd, error) { 465 + func (me *Worker) Command(ctx context.Context, args []string) (*exec.Cmd, error) { 466 466 if args == nil { 467 467 args = []string{} 468 468 } ··· 486 486 "command": "run", 487 487 "entrypoint": me.App.Entrypoint(), 488 488 "args": args, 489 - "input": base64.StdEncoding.EncodeToString(input), 490 489 }); err != nil { 491 490 return nil, fmt.Errorf("could not encode input: %w", err) 492 491 }