Skip to content

Unable to build an app in a directory that has a tasks.cr file #882

@jwoertink

Description

@jwoertink

Right now we assume that if there's a tasks.cr file, then you must be inside a Lucky app directory

inside_app_directory = File.file?(tasks_file)

Then when you run lucky -h you'll get different output depending... This is helpful to avoid an issue where you generate a Lucky app inside of a Lucky app accidentally...

However, Breeze has a tasks.cr file, and is not a Lucky app... so when trying to run the integration specs https://github.com/luckyframework/breeze/blob/674b438fde9da5686a49c9e35290365e45bf9f85/spec/integration_spec.cr#L11 it attempts to build a Lucky app inside of the root of the breeze directory, and instead of just saying "nope", you get

❯ lucky init.custom test-project
Showing last frame. Use --error-trace for full trace.

In lib/avram/src/avram/database.cr:156:5

 156 | settings.credentials
       ^-------
Error: undefined local variable or method 'settings' for Avram::Database+.class

which really makes no sense... Moving this to a tmp/ dir "solves" it...

I do like having the safety of not accidentally generating an app inside an existing app, but I guess is it really necessary vs what we lose not being able to?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions