cake-bake
Bake
Bake Cakefile into native Crystal code.
Why?
Because sometimes cake tasks are wanted to be run as binaries.
For example, to run from a Docker container with an already built application: docker run my-crystal-app bin/cake db:migrate
.
Installation
Add this to your application's shard.yml
:
targets:
cake:
main: src/run/cake.cr
dependencies:
bake:
github: vladfaust/bake
Usage
Given ./Cakefile
:
require "./src/some_file" # These requires
task :foo
puts "bar"
end
./src/run/cake
:
require "bake"
bake("../../Cakefile") # Full path to Cakefile needed to properly resolve requires (see above)
Then execute from ./
:
$ crystal src/run/cake -- foo
bar
$ crystal build src/run/cake
$ ./cake foo
bar
$ shards build
$ ./bin/cake foo
bar
Contributing
- Fork it ( https://github.com/vladfaust/bake/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
Contributors
- @vladfaust Vlad Faust - creator, maintainer