Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add inline docs for new LUCKY_TASK env in scaffolded apps #595

Merged
merged 1 commit into from
Dec 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/web_app_skeleton/config/env.cr
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ module Lucky::Env
ENV["LUCKY_ENV"]? || "development"
end

# Returns true if a task is being run through the `lucky` cli
#
# Use this method to only run (or avoid running) code when a task is executed.
def task?
ENV["LUCKY_TASK"]? == "true"
end
Expand Down
2 changes: 2 additions & 0 deletions src/web_app_skeleton/tasks.cr
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#
# Learn to create your own tasks:
# https://luckyframework.org/guides/command-line-tasks/custom-tasks

# See `Lucky::Env#task?` in `config/env.cr`
ENV["LUCKY_TASK"] = "true"

# Load Lucky and the app (actions, models, etc.)
Expand Down