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

Mysterious dots prepended in .processNameByPath #4

Open
afoeder opened this issue Oct 16, 2014 · 1 comment
Open

Mysterious dots prepended in .processNameByPath #4

afoeder opened this issue Oct 16, 2014 · 1 comment
Labels

Comments

@afoeder
Copy link

afoeder commented Oct 16, 2014

I am trying to adjust the processName but get three leading dots after applying declare.processNameByPath:

gulp.src(['../Packages/Application/Acme.Ui/Resources/Private/Scripts/Ember/Templates/**/*.hbs'])
    .pipe(handlebars({ handlebars: require('ember-handlebars') }))
    .pipe(wrap('Ember.Handlebars.template(<%= contents %>)'))
    .pipe(declare({
        namespace: 'Ember.TEMPLATES',
        noRedeclare: true,
        processName: function(filePath) {
            // filePath is ``/Users/afoeder/PhpstormProjects/acme/Distribution/Packages/Application/Acme.Ui/Resources/Private/Scripts/Ember/Templates/Login.js``
            // declare.processNameByPath(filePath) is ``...Packages.Application.Wishbase.Ui.Resources.Private.Scripts.Ember.Templates.Login.``

            return declare.processNameByPath(filePath.replace('Packages/Application/Wishbase.Ui/Resources/Private/Scripts/Ember/Templates/', ''));
            // this, however, will still return ``...Login``
        }
}))

The location of the gulpfile is at /Users/afoeder/PhpstormProjects/acme/Distribution/Build/, is this maybe the reason why some relative path determinition doesn't work well?

Thanks for your support!

@lazd
Copy link
Owner

lazd commented Dec 1, 2014

Hey @afoeder, I agree declare.processNameByPath() should handle this case. In the mean time, you can remove the ../ from the path in your replace() and things should behave as expected.

@lazd lazd added the bug label Dec 1, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants