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

Add ability to strip arbitrary prefix #8

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

Conversation

mikeymc
Copy link

@mikeymc mikeymc commented Sep 2, 2015

In response to #5

This feature adds the ability to strip an arbitrary prefix from the input file name.

In our last two projects, we found it difficult to figure out how to strip a prefix from a file name to be placed into the key of the $templateCache.put(). We wished there was a way to simply strip some arbitrary prefix, but that feature did not exist. We saw the -b/--basedir option, but we could not figure out how to use it properly. As a result, we found ourselves having to change directories to the level where the relative path to the file would wind up being what we wanted to see in the key of the $templateCache.put(). This was a drag. It seems others have also had similar issues with the --basedir option. So, we added the ability to strip an arbitrary prefix.

The behavior of the feature is specified in the tests that accompany this pull request.

In short, to strip an arbitrary prefix, run the following:

./path/to/ng-html2js path/to/file.tmpl -s path/to/

this will yield:

$templateCache.put('file.tmpl', 'the-rest-of-the-magic-goodness')

@mikeymc
Copy link
Author

mikeymc commented Sep 2, 2015

Tests will fail until CI switches to jasmine

@yaru22
Copy link
Owner

yaru22 commented Sep 8, 2015

There seems to be conflicts after merging pr #7. Could you merge with the latest for this PR?

This was referenced Sep 11, 2015
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.

2 participants