krieselreihe / litr

Litr (Language Independent Task Runner) lets you configure and then run any tasks you want for any language.
MIT License
8 stars 0 forks source link

How to call commands from within #2

Open MartinHelmut opened 3 years ago

MartinHelmut commented 3 years ago

Concept

Commands defined with Litr should be callable with Litr.

Idea 1 - As shell script

To call a command defined through Litr itself you could write it as you would in your shell:

[commands.build]
script = "cmake ..."

[commands.run]
script = [
  "litr build",
  "./build/start"
]

Pros

Cons

Idea 2 - Special syntax

Another way could be with a special syntax.

# Syntax is not final
[commands.build]
script = "cmake ..."

[commands.run]
script = [
  "[[build]]",
  "./build/start"
]

Pros

Cons

MartinHelmut commented 3 years ago

Idea for going forward:

MVP

Do not do anything. Scripts within scripts will just work as defined in the first scenario.

Version 1

Create script environment as closure to save on parsing and env creation. Explore how to re-use the already parsed configuration file.

Extra

Explore the second scenario for a special syntax.