ZupIT/ritchie-docs

Outdated example for programatic "create formula"

Opened this issue · 1 comments

The programatic way to execute rit create formula has a non-working example in the Core commands page.

A working example follows below:

cat << EOF |
{
    "formulaCmd": "rit oioi teste",
    "lang": "shell-bat",
    "workspace": {"name": "my-formulas", "dir": "/home/fulano/projetos/xxx" },
    "formulapath": "/home/fulano/projetos/xxx/oioi/teste/"
  }
EOF
rit create formula --stdin

If there is another way to do the same without stdin (using flags) current docs do not show it too.

Hi @andrevtg , thank you for opening this issue 👍🏼

You're right, this core command doesn't use these inputs anymore and we'll have to update it on the documentation.

You can check which inputs are available by using rit create formula --help and you'll see that in the latest version the inputs are now:

Options:
      --language='': Select formula's language (i.e: go, java, python [...])
      --name='': You must create your command based in this example [rit group verb noun]
      --workspace='': Provide workspace name

Therefore, the correct syntax is now something like this: echo '{"name":"rit demo create formula", "language":"shell", "workspace":"Default"}' | rit create formula --stdin

Spoiler: the next release (2.12.0) will also provide support for inputs flags, allowing you to create formulas using: rit create formula --name="rit demo create formula" --language="shell" --workspace="Default"