workshopper icon indicating copy to clipboard operation
workshopper copied to clipboard

Allow the `.config` "folder" to be configurable or changed.

Open 3rd-Eden opened this issue 9 years ago • 6 comments

We've just ran in to an issue where .config as actually a configuration file for a different application causing the workshopper to fail with ENOTADIRFUCKYOU error message. It would be nice to handle these problems more gracefully by either falling back to a different configuration folder name or allowing users to specify the configuration folder with like --config CLI flag.

Affected lines: https://github.com/workshopper/workshopper/blob/4d277b03c103d1ba591e6ef8c164ba92c586f48e/workshopper.js#L39-L40

3rd-Eden avatar May 22 '15 18:05 3rd-Eden

I've switched https://github.com/rvagg/ghauth to http://ghub.io/application-config thanks to a PR from @LinusU, perhaps he'd like to do the same here? I'd be happy to see .config changed to a cross-platform compatible solution.

rvagg avatar May 27 '15 02:05 rvagg

I'd be happy to send a pull request :+1:

Hopefully I can find some time this weekend

LinusU avatar May 27 '15 15:05 LinusU

Well the application-config still defaults to .config for windows which will result in the same issue.

3rd-Eden avatar May 27 '15 15:05 3rd-Eden

@3rd-Eden Just to be clear: The path that results in a ENOTADIRFUCKYOU error is %USER_DIR%/.config If we were to start using application-config that directory would change to % LOCALAPPDATA%/workshopper/config.json Which is would resolve your issue.

And that is where its actually a bit hairy with this PR:

  1. Please make sure it has legacy support (i.e. if there is a .config directory that contains workshopper data, read it.
  2. To not have a conflict with different applications I think the workshoppers naming should have npm namespacing: i.e. npm-js-workshopper or Nodejs-npm-workshopper or so that should make sure that no other "Workshopper" app uses the same storage folder.

Sidenote: Pinging @gangstead and @sequoia because I think it would be a good section in a command line workshopper ...

martinheidegger avatar May 27 '15 16:05 martinheidegger

I think @sequoia's clijs because it covers all things command line in a more comprehensive fashion. comder just focuses on the commander.js library.

gangstead avatar May 27 '15 17:05 gangstead

@martinheidegger tyvm. I was planning a section on RC files but this would be a good complement to that.

Sequoia avatar May 27 '15 19:05 Sequoia