Skip to content

Allow cabal init to create a new project directory #7871

Closed

Description

@konsumlamm

Currently, cabal init initializes a new project in the current directory. It would be nice if it could also create a new directory where the project is located, so that one doesn't have to do that manually, similar to stack new. This could also be a new cabal new command.

Activity

  1. Mikolaj commented on Dec 19, 2021

    @Mikolaj
    Member

    Or cabal init new? @ptkato: what do you think? Perhaps this is already possible somehow?

  2. ptkato commented on Dec 19, 2021

    @ptkato
    Collaborator

    I don't think it's possible as it is right now; however I also don't think it would be a hard feature to implement at all. I'll come up with a PR. About the command, I'm not sure about neither cabal init new or cabal new, I believe that it might fit better to define it as a flag.

  3. bacchanalia commented on Dec 19, 2021

    @bacchanalia
    Collaborator

    cabal init currently takes no arguments. Instead it could take one optional argument which is the name of the directory to create and init in, and the behavior with no arguments would stay the same (init in the current directory).

  4. ptkato commented on Dec 20, 2021

    @ptkato
    Collaborator

    There we go, yes, using the extra arguments is way more self-contained.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions