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

Git template fix #48

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Git template fix #48

wants to merge 4 commits into from

Conversation

bbito
Copy link

@bbito bbito commented Nov 26, 2018

The enyo templates install command is for installing templates from git repositories as shown in the README.md example:

# you can install a remote template
enyo templates install https://github.com/enyojs/moonstone-template.git

This is very convenient, but when using a git repo as illustrated in the example, the repo will be cloned into enyo-dev's templates directory including the template repo's .git directory and README.md as an inited local repo. This is a reasonable course of action allowing an end user to identify where a template came from and potentially modify it and push changes upstream. What is problematic is that when that template is used via enyo init the full template directory is copied into the new enyo project including the template's .git directory. The user is expecting a fresh project ready for work and may easily start making commits without realizing that they are committing to the template's repo rather than to their fresh project repo as they may reasonably assume.

This pull request attempts to fix this significant problem by avoiding copying the .git directory from the enyo templates directory when enyo init is called.

It would be nice to avoid copying the README.md as well, but I could not come up with a reasonable way to do that within the existing code. Perhaps a .enyoinitignore file along the lines of a .gitignore file could be used by template creators to specify which files should not be used by enyo init, but the presence of a README.md file from a template repo inside of a newly inited project is a minor nuisance compared to that project having a .git directory from the template repo in it.

If a enyo-dev template repo is needed to test this PR, please feel free to use mine:
https://github.com/bbito/onyx-webos-app.git

-Thanks,
--bbito

There is no need to check the entire concatenated `src` string,
instead check for the file name in `files[i]`.
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.

1 participant