-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Adds CLI support for partials with relative paths #558
Conversation
This sounds like a good fix 👍 Would you be able to add tests verifying this behavior? |
I will be writing tests for this, but I was getting 11 failed tests on windows (before I changed anything), so I figured I would take a look at that while I'm at it, most likely this weekend |
Ooh, that doesn't sound good! If you'd like some help with those failing On Friday, 15 April 2016, kookookchoozeus notifications@github.com wrote:
|
Opened #559, in case the fix is immediately apparent to anyone |
var relativePath = path. | ||
relative(templateArg, filename). | ||
replace('.mustache', ''). | ||
replace(/\\{1,2}/g, '/'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dots on the left, like pointed out in the other PR.
Lacks tests asserting that the feature works. LGTM except for that + the style comments. Thanks! |
Excuse my inexperience with contributing/forks/github in general, but this PR originally was based on the master branch of my fork. Once #559 (fixing tests for Windows) was opened, I made a new branch for that, and did all changes there. That PR was merged, and I merged my local changes (for the relative paths) with the new CLI changes. However, my repo now says it's one commit behind |
@kookookchoozeus Sorry for the delayed response (bit of a blame on GitHub dismissing desktop notifications when you read the email...) I got what you mean, I hope I can explain myself as well: The main problem is that I "squashed & merged", meaning that your commits were taken and combined/smashed into a single new commit, which was put on top of our Which means that when Git compares your local The better workflow for making multiple PRs, and branches that work on top of other branches (imo and from my experience) is:
Let me know if something is not clear 🙈 |
Also, if you don't know about I also recommend that you have a copy in the repo in case you are new to doing this and you don't want to end up losing code by mistake. Commits can be recovered even if they are not part of a branch anymore, but it's a bit of a hassle. |
Thanks for the writeup :^) It'll serve as a nice reference for similar problems in the future. I've opened a new pull request (#563), so I'll close this one |
Currently, if two partials with the same filename are passed through the CLI:
bash
mustache -p src/templates/header.mustache -p src/templates/common/header.mustache view.json template.mustache
{{> header }}
{{ ../common/header }}