viash-io / viash

script + metadata = standalone component
https://viash.io
GNU General Public License v3.0
39 stars 2 forks source link

Allow zero arguments #23

Closed rcannood closed 3 years ago

rcannood commented 3 years ago

The following yaml:

functionality:
  name: test
  resources:
    - type: bash_script
      dest: script.sh
      text: |
        echo Hello world
platforms:
  - type: native

Produces an error:

$ viash run config.vsh.yaml 
Exception in thread "main" DecodingFailure(Attempt to decode value on failed cursor, List(DownField(arguments), DownField(functionality)))

This problem can be avoided by specifying arguments as an empty list:

functionality:
  name: test
  resources:
    - type: bash_script
      dest: script.sh
      text: |
        echo Hello world
  arguments: []
platforms:
  - type: native

However, viash should be changed such that the first yaml also works.

rcannood commented 3 years ago

Solved in 95166f70dea4c2c7e11724b768db026a90d14390.