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 task env detection #576

Merged
merged 3 commits into from
Dec 14, 2020
Merged

Add task env detection #576

merged 3 commits into from
Dec 14, 2020

Conversation

KCErb
Copy link
Contributor

@KCErb KCErb commented Nov 4, 2020

I think it'd be nice to know that a task runner is calling your app code sometimes. So these changes add an env var to the entrypoint tasks.cr and a helper in the env config.

My specific use case is that I have some code I want to run during server startup, but not during db.migrate and friends. This PR will allow me to guard that code like so:

Something.init unless Lucky::Env.task?

Copy link
Member

@jwoertink jwoertink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it 👍 I think you'll need to run ameba or the formatter locally so that part passes, but the specs are gonna fail until we get a few other things in.

@jwoertink
Copy link
Member

Ok, you'll have to rebase, but then specs will be good 👍

@jwoertink jwoertink merged commit dcb42fb into luckyframework:master Dec 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants