kytta / skyr

🐮 Low-fat task runner.
https://os.kytta.dev/skyr
ISC License
2 stars 0 forks source link

Add dependency and target tracking #8

Open kytta opened 1 year ago

kytta commented 1 year ago

Similarly to Make, Skyr should be able to determine whether a script should be executed based on the dependencies and targets.

I propose doing this by adding Skr-specific headers to the files. For example:

#!/bin/sh
# Skyr-Depends-On: src/*.py
# Skyr-Target: dist/mypkg-*

If Skyr-Depends-On is not provided, no check is made; the script is always executed. If Skyr-Target is not provided, the script is considered "PHONY". Later, I might add a cache to track modification dates for those scripts.

kytta commented 2 months ago

Another idea: Use a modified version of Python inline script metadata with type skyr and independence of comment styles (e.g. // /// skyr is valid in JS)

kytta commented 2 months ago

Use a modified version of Python inline script metadata

In that case, the body does not have to be TOML, we can stick to INI (it might be easier on the eye for lists of files)