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
support absolute path in .bowerrc directory option #2130
Conversation
Hey. Could you fix it and squash the changes? |
Yep, saw that and will switch to Q. |
f9fb325
to
2c5034e
Compare
2c5034e
to
2110148
Compare
@@ -124,7 +125,7 @@ Manager.prototype.resolve = function () { | |||
|
|||
Manager.prototype.preinstall = function (json) { | |||
var that = this; | |||
var componentsDir = path.join(this._config.cwd, this._config.directory); |
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.
Maybe we can use path.resolve
instead? to support relative config.directory
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.
When the config.directory begins with an /
it's expected to be absolute. In any other case the path is expected to be relative and joined with config.cwd
. Not sure if I understood your comment correctly. How can path.resolve
help here?
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.
resolve "removes" ..
from joined path.
path.join('/foo/bar', '../baz') == '/foo/bar/../baz'
path.resolve('/foo/bar', '../baz') == '/foo'
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.
Done
I think there are some tests missing, because you did not change: |
9a4b04a
to
a2696d2
Compare
a2696d2
to
5384fa5
Compare
I think it's good now. Thank you for being patient |
support absolute path in .bowerrc directory option
As discussed in #1914 we want to support absolute paths in
.bowerrc
directory option. A simple check if the directory begin with a/
decides whether the path is relative and prefixed with the current work directory or taken as absolute path.