workshopper
workshopper copied to clipboard
Allow the `.config` "folder" to be configurable or changed.
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
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.
I'd be happy to send a pull request :+1:
Hopefully I can find some time this weekend
Well the application-config
still defaults to .config
for windows which will result in the same issue.
@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:
- Please make sure it has legacy support (i.e. if there is a .config directory that contains workshopper data, read it.
- To not have a conflict with different applications I think the workshoppers naming should have npm namespacing: i.e.
npm-js-workshopper
orNodejs-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 ...
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.
@martinheidegger tyvm. I was planning a section on RC files but this would be a good complement to that.