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

support absolute path in .bowerrc directory option #2130

Merged
merged 2 commits into from Jan 5, 2016

Conversation

gronke
Copy link
Member

@gronke gronke commented Jan 2, 2016

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.

@sheerun
Copy link
Contributor

sheerun commented Jan 3, 2016

Hey. Promise is not available in node 0.10. We use Q library for promises.

Could you fix it and squash the changes?

@gronke
Copy link
Member Author

gronke commented Jan 3, 2016

Yep, saw that and will switch to Q.

@gronke gronke force-pushed the enhancement/absolute-paths-1914 branch 3 times, most recently from f9fb325 to 2c5034e Compare January 4, 2016 00:29
@gronke gronke force-pushed the enhancement/absolute-paths-1914 branch from 2c5034e to 2110148 Compare January 4, 2016 00:47
@@ -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);
Copy link
Contributor

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

Copy link
Member Author

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?

Copy link
Contributor

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'

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@sheerun
Copy link
Contributor

sheerun commented Jan 4, 2016

@gronke gronke force-pushed the enhancement/absolute-paths-1914 branch 2 times, most recently from 9a4b04a to a2696d2 Compare January 5, 2016 04:04
@gronke gronke force-pushed the enhancement/absolute-paths-1914 branch from a2696d2 to 5384fa5 Compare January 5, 2016 04:23
@sheerun
Copy link
Contributor

sheerun commented Jan 5, 2016

I think it's good now. Thank you for being patient

sheerun added a commit that referenced this pull request Jan 5, 2016
support absolute path in .bowerrc directory option
@sheerun sheerun merged commit 671c23a into bower:master Jan 5, 2016
@gronke gronke deleted the enhancement/absolute-paths-1914 branch January 5, 2016 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

3 participants