#here's an example I haven't tried

1 messages · Page 1 of 1 (latest)

weak warren
#
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
oblique escarp
#

☝️ 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

weak warren
#

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

oblique escarp
#

but it's only used by other modules, didn't tried from console

viral eagle
#

Hm yeah I think you're supposed to follow the cobra cli convention of repeating the flag to provide more values:
dagger call --args a --args b --args c

But I just tried w/ dagger call and it error'd out

#

Checking if it's a quick fix