Skip to content

Conversation

@michaelsbradleyjr
Copy link
Contributor

@michaelsbradleyjr michaelsbradleyjr commented Aug 12, 2018

Overview

When embark is installed via npm, the templates' .gitignore files (which make it into the pkg tarball by way of the negation included in embark's .npmignore, owing to #694) are auto-renamed to .npmignore. This npm behavior cannot be remedied, it seems, by including empty .npmignore files in the template directories.

So, this PR uses a different approach: template directories have a file named dot.gitignore and during template installation (via embark demo or embark new) the copied dot.gitignore (within the template instance) is renamed to .gitignore.

utils.cd(templatePath);
utils.sed('package.json', '%APP_NAME%', name);
if (fs.existsSync('dot.gitignore')) {
fs.moveSync('dot.gitignore', '.gitignore');
Copy link
Collaborator

Choose a reason for hiding this comment

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

Won't move make the file "disappear" form the global install? Making it impossible to install the template twice? Shouldn't you copy instead?

Copy link
Contributor Author

@michaelsbradleyjr michaelsbradleyjr Aug 13, 2018

Choose a reason for hiding this comment

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

It's only being moved inside the template instance. templatePath is the same as fspath a few lines above, which is derived from destinationFolder.

I was, though, concerned about this very thing. So I manually checked that it's only getting moved inside the template instance, and that in embark's template dir the file is still dot.gitignore.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh duh, you're right.

@michaelsbradleyjr michaelsbradleyjr merged commit 682f49f into develop Aug 13, 2018
@michaelsbradleyjr michaelsbradleyjr deleted the templates-gitignore-2 branch August 13, 2018 16:55
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.

3 participants