FEATURE REQUEST: default task
The simplest way seems to be to look for a task named "default" and append it to ARGV.clone when it's empty?. If there's no task named default, then raise.
Current hack:
task "default", ["do:something", "something:else"] do
end
ARGV << "default" if ARGV.empty?
Sam.help
thank you for this suggestion. Is it dictated by a real world scenario of just a suggestion? From my experience such kind of behavior would not be expected - normally you always have some kind of "script/task name" to execute (e.g. in npm, ruby's rake and so on).
There's a need to automatically rebuild local dev tools including sam, ameba, and sentry based on configuration .cr files. Rebuilding each every time would be wasteful.
rake has a default task, and it happens so do make and just. If it's not obvious, they support both file and phony targets to avoid unnecessary expensive tasks.
npm is a different use-case unrelated to a statically-compiled language such as Crystal.
On Mon, Jun 5, 2023 at 10:46 AM Roman Kalnytskyi @.***> wrote:
thank you for this suggestion. Is it dictated by a real world scenario of just a suggestion? From my experience such kind of behavior would not be expected - normally you always have some kind of "script/task name" to execute (e.g. in npm, ruby's rake and so on).
— Reply to this email directly, view it on GitHub https://github.com/imdrasil/sam.cr/issues/21#issuecomment-1577046907, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABWYMBR7BWGYS3AODPF7UTXJX5MDANCNFSM6AAAAAAYUUQOZU . You are receiving this because you authored the thread.Message ID: @.***>
looks reasonable. I'll take a look at this later this week