dominictarr/rc

filename/path examples

Closed this issue · 10 comments

I'm trying to create an rc for use with node-inspector on Windows and not seeing the config take affect. On the off-chance, that it's that package, I've posted there also though I'm confident it's just me being slow in interpreting the README for this project and to that end I was hoping that this request and responses it gets will help others in the future or lead to content for the README that would have gotten through to the likes of me :)

That said, the way I interpret the README is as follows:

  • Assume my app is at c:\projects\my-app
  • Assume that in that folder a package.json exists that includes { "name": "my-app" }
  • Assume that my user folder is c:\users\myusername

I'm under the impression that any of the following locations would be valid for an rc file. Please let me know if the following demonstrates where I've gone wrong and how to correct it:

  • c:\projects\my-app\.$my-apprc
  • c:\projects\.$my-apprc
  • c:\users\myusername\.$my-apprc
  • c:\users\myusername\.$my-apprc
  • c:\users\myusername\.$my-app\config
  • c:\users\myusername\.config\.$my-app

first thing, rc does not look in your package.json.
probably the problem here is rc is not interpreting your windows installation quite the way you intend it.

can you run the following code for in your node repl?:

console.log(process.platform, process.env.USERPROFILE, process.env.HOME)

Otherwise, or is there another enviroment variable that points to c:\users\myusername?

Thank you. That explains a good bit of my confusion then. How does it resolve appname then?

Here's that output:
win32 C:\Users\myusername C:\Users\myusername

okay that should work then... this is very tricky to debug because it's on your system but not on mine.
hmm, there havn't been any changes to windows since the version node-inspector uses.
one thing you can try is do npm install -g rc and then run rc {appname} and it will output the configuration as if you ran the program from that location.

if you do that and run rc node-inspector it should display the configuration that node-inspector will load.

I think it just clicked. I was exposed to rc thanks to node-inspector. I was thinking that {appname} would be resolved to my apps name through package.json and now I'm thinking that the {appname} in this case would be node-inspector so what I should do (to have preference specific to my app, for node-inspector) is maintain those node-inspector preferences in c:\projects\my-app\.$node-inspector and if I wanted those preference for node-inspector to be more global, then I'd use c:\users\myusername\.$node-inspector\config or perhaps c:\users\myusername\.$node-inspector

This makes sense now so if I'm right, THAT is where I went all wrong. If that's not the case, hopefully we're closer to you seeing the source of my confusion :)

that is correct. (leave out the $ from those paths though!
oh it will be c:\projects\my-app\.node-inspectorrc and c:\users\myusername\.node-inspector\config

Why the inclusion of "my-app" in this instance? c:\projects\my-app\.node-inspectorrc

Once I've wrapped my brain around this, would a PR be welcome to expand the README to provide some additional examples that would have helped someone with my perspective (and a Windows user)?

Also, is the following complete and valid, or should I be using AMD exports or such?

{
  "save-live-edit": true,
  "preload": false,
  "hidden": [ "node_modules/" ],
  "nodejs": ["--harmony"]
}

@rainabba I don't know anything about node-inspector, you should post those issues on that repo.

If you run node-inspector from within c:\projects\my-app\ it will find the local .node-inspectorrc it looks in parent directories recursively, so it will check c:\projects\my-app\ then c:\projects\ then c:\ and use the first one it finds.

I'm good and clear now. Thank you for all the help and sorry I didn't close this yesterday.

no prob!

On Fri, Feb 19, 2016 at 1:07 PM, rainabba notifications@github.com wrote:

I'm good and clear now. Thank you for all the help and sorry I didn't
close this yesterday.


Reply to this email directly or view it on GitHub
#74 (comment).