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

'project' directory does not get generated #383

Open
Philippus opened this issue Jun 25, 2018 · 7 comments
Open

'project' directory does not get generated #383

Philippus opened this issue Jun 25, 2018 · 7 comments
Labels

Comments

@Philippus
Copy link
Contributor

Philippus commented Jun 25, 2018

using the g8 command (0.10.0 version) on a template with a project directory generates all the files and directories except the project directory.
Renaming the directory to f.e. projectt works, and using the sbt new command instead also works.

@Philippus
Copy link
Contributor Author

Philippus commented Jun 26, 2018

this seems to be related to the .gitignore file I have in my template under /src/main/g8/. I have the following entries in it:
project/activator-sbt* - result: 'project'-directory does not get generated - looks to be #382
data/* - result: 'data'-directory does not get generated
.env - result: '.env'-file does not get generated

Somehow the /src/main/g8/.gitignore seems to be taken into account during generation using the g8 command. This is not what I expected, additionally the sbt new command behaves differently.

@Philippus
Copy link
Contributor Author

Solved for now by adding some exclusion rules in a .g8ignore file in the project root.

@chrisbenincasa
Copy link

@Philippus does the .g8ignore file take precedence over the .gitignore when present?

@eed3si9n eed3si9n added the Bug label Jul 15, 2018
@Philippus
Copy link
Contributor Author

yes, I found this out reading the test cases:

it should "allow .g8ignore to take precedence over .gitignore" in testCase {

@nicopap
Copy link

nicopap commented May 18, 2020

Workaround

For posterity, here is an example on how to add a file ignored by .gitignore to the giter8 template.

Suppose this is you project structure:

.
├── build.sbt
└── src
    └── main
        └── g8
            ├── credentials.secrets
            └── .gitignore

and your .gitignore contains the following:

credentials.secrets

When using sbt new, the generated project will be:

.
└── .gitignore

Without containing the credentials.secrets.

Now, if you want the credentials.secrets to be present in the generated directory, while still being ignored in the .gitignore, you need to add a .g8ignore to the root of the g8 project that explicitly "not ignore" credentials.secrets. Such as you will end up with the following:

.
├── build.sbt
├── .g8ignore
└── src
    └── main
        └── g8
            ├── credentials.secrets
            └── .gitignore

Where .g8ignore contrains (in our case:)

!credentials.secrets

Now the generated project structure should be:

.
├── credentials.secrets
└── .gitignore

@TonioGela
Copy link
Member

@nicopap your comment should be treated as documentation

@fmv1992
Copy link

fmv1992 commented Oct 3, 2021

This is unnecessarily complex to be honest. It took a while to figure this out and this is barely documented.

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

No branches or pull requests

6 participants