Add the following code to your project's shard.yml under:
to use in production
- OR -
development_dependencies to use in development
A Crystal library for creating command line tasks to be used with the LuckyCli.
Add the dependency to your
dependencies: lucky_task: github: luckyframework/lucky_task
Create a file
tasks.cr at the root of your project
require "lucky_task" # Using `lucky` from the command line will do nothing if you forget this LuckyTask::Runner.run
tasks directory in the root of your project.
tasks.cr file to require all files within that directory for them to be registered with the CLI.
# tasks.cr require "lucky_task" require "./tasks/*"
In the directory create a file called
class SendDailyNotifications < LuckyTask::Task summary "Send notifications to users" # Name is inferred from class name ("send_daily_notifications") # It can be overridden: # # name "app.send_daily_notifications" def call # Code that sends notifications to all your users... end end
git checkout -b my-new-feature)
git commit -am 'Add some feature')
git push origin my-new-feature)