Skip to content

Strip prefix - #10

Merged
yaru22 merged 11 commits into
yaru22:masterfrom
mikeymc:strip-prefix
Sep 13, 2015
Merged

yaru22 merged 11 commits into
yaru22:masterfrom
mikeymc:strip-prefix

Conversation

@mikeymc

@mikeymc mikeymc commented Sep 11, 2015

Copy link
Copy Markdown

In response to the previous response to #8 with this work, please try this one.

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')

yaru22 added a commit that referenced this pull request Sep 13, 2015
@yaru22
yaru22 merged commit 385f5ec into yaru22:master Sep 13, 2015
@yaru22

yaru22 commented Sep 13, 2015

Copy link
Copy Markdown
Owner

Thanks @mikeymc! Your contribution is very much appreciated.

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