#here's an example I haven't tried
1 messages · Page 1 of 1 (latest)
package main
import (
"context"
)
type Gh struct{}
func (m *Gh) Run(ctx context.Context, args []string) (string, error) {
return dag.Container().
From("alpine:latest").
WithExec(args).
Stdout(ctx)
}
gh ➤ dagger call run --args sh,-c,ls git:main*
✘ dagger call run ERROR [0.00s]
┃ Error: response from query: input:1: Argument "args" has invalid value {value: ["sh", "-c", "ls"], change
┃ true}.
┃ Expected type "String", found {value: ["sh", "-c", "ls"], changed: true}.
┃ Error: cannot parse *ast.ObjectValue to string
• Engine: 64bf1cf27353 (version v0.9.1)
⧗ 2.02s ✔ 19 ∅ 6 ✘ 1
☝️ This module could be broken at the moment. I was using it for gale but removed it from `dependency last week. I didn't able to check with latest version yet
cool. I stripped out everything to see if I could get array args to work, but not sure if they are allowed at the moment... @viral eagle
I couldn't make them work either. Currently using this workaround https://github.com/aweris/gale/blob/3bf05266c161ddba192d72a3fb160bad7379b8dd/daggerverse/actions/runtime/action_run.go#L51-L59
but it's only used by other modules, didn't tried from console