-
Notifications
You must be signed in to change notification settings - Fork 20
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
{dir}
is incorrect when using with url-template -o parameter
#9
Comments
I have inspected the problem a bit further. url-templateIt seems that const urlTemplate = require('url-template')
const template = urlTemplate.parse('{dir}/{name}.sq{ext}')
template.expand({ dir: 'test', name: 'a', ext: '.jpg' })
// outputs "test/a.sq.jpg"
template.expand({ dir: 'test/test', name: 'a', ext: '.jpg' })
// outputs "test%2F/a.sq.jpg" absolute path + url-templateThe problem lives here: Lines 52 to 53 in 87b9340
If Maybe it should be absolute-ised later, if not already absolute (cf. Line 59 in 87b9340
Maybe some additional modifiers like What do you think? |
Thank you for looking into this - I think I'll have to rethink using |
Oh bummer! Thanks for the heads upb and for the finding; I totally missed it from the syntax! Than you so much :-) |
Hello!
Thanks for this tool, it works beautifully and is probably the best in town :-)
I discovered
url-template
but the{dir}
directive does not correspond to what I expected. Ref torequire('path').parse
.For example, this is a command I used and did not work as expected:
I was expecting
{dir}
to be equal to eithercontent/playstation/images
or/Users/oncletom/workspace/emunova/emunova.net/content/playstation/images
.{dir}
looks like an encoded value of some sort, which is prefixed by$(pwd)
.Am I using it wrong?
Thanks for your help :-)
The text was updated successfully, but these errors were encountered: