Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

--config does not take absolute path #583

Closed
xkxx opened this issue Apr 20, 2015 · 6 comments · May be fixed by tobybellwood/govstrap#4
Closed

--config does not take absolute path #583

xkxx opened this issue Apr 20, 2015 · 6 comments · May be fixed by tobybellwood/govstrap#4
Labels

Comments

@xkxx
Copy link

xkxx commented Apr 20, 2015

Hello,

Currently --config does not take absolute paths. For example, doing something like this throws an error:

> browser-sync start --config /etc/bs-config.js

module.js:318
    throw err;
    ^
Error: Cannot find module '/path/to/cwd/etc/bs-config.js'

This is caused by browser-sync/lib/cli/cli-info.js:28:

        return require(path.resolve(process.cwd() + "/" + filePath));

Which tries to resolve relative url by prepending process.cwd(), but that's the job of path.resolve.
Changing this line to the following does the correct thing, and fixes the issue:

        return require(path.resolve(process.cwd(), filePath));

Thanks,

Kexiang

@shinnn
Copy link
Contributor

shinnn commented Apr 20, 2015

Confirmed. Thanks for your detailed reporting, @xkxx.

@shakyShane
Copy link
Contributor

thanks @xkxx - but where is the PR ? :p

@shakyShane shakyShane added the bug label Apr 20, 2015
@xkxx
Copy link
Author

xkxx commented Apr 20, 2015

I thought about it, but then thought it was too trivial to be worth a PR - hope I have provided enough info for you guys to fit it :)

@shakyShane
Copy link
Contributor

Nothing is too trivial for a PR :)

@xkxx
Copy link
Author

xkxx commented Apr 20, 2015

Speaking of trivial PRs, would you mind taking a look at shakyShane/html-injector#5?
It fixes a problem with browser-sync failing when ui is disabled. Travis CI test is failing, but I don't really know about the inner-workings of the module to get what's going on.

@shakyShane
Copy link
Contributor

Ahh yeah I saw that - it's on the list for the next round of bug fixes / pr's :)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants