Ability to configure devDir with flag [#21]#540
Ability to configure devDir with flag [#21]#540grahaml wants to merge 6 commits intonodejs:masterfrom
Conversation
- Allows users to specify development directory using '--dev-dir' flag - Added check for XDG_CACHE_HOME before HOME
|
Hi @TooTallNate -- submitting this PR because we ran into problems when Thanks! |
There was a problem hiding this comment.
Flag name should be --devdir to parallel the --nodedir flag.
|
@TooTallNate, please merge this PR with your suggested change |
|
@TooTallNate I completely forgot about this PR until @dantran commented about making your suggested change. I have updated the code to use |
|
A reminder/vote for this PR. Is it OK to merge? |
|
Very useful concept, but can we name it more meaningfully (we also have |
|
The default for I'll also point out that under the XDG dir, the node-gyp dir ought to be So I think the directory priority ought to be:
|
|
Making devDir configurable seems reasonable to me but I'm less convinced that honoring XDG_CACHE_HOME is a good thing. For one, the way it's done in this PR would force everyone to download tarballs again (because the cache directory changes) when it's released. I agree with @saper that the name is not great. Something like Also, it would be good to have a regression test or two. |
That's a valid reason against the way this PR is written, but I don't think it's necessarily a strike against XDG_CACHE_HOME in principle. An option is to choose the directory based on which one exists and not by which env var is set (in the order I listed). This would prevent re-downloading everything. And it would allow a manual (one-time) opt-in for users to just move their If none of the directories already exist, then choose (and create) the directory based on the env vars. |
|
What I missed in the discussion in #21 is why following XDG_CACHE_HOME and XDG in general is a good thing. XDG is not a thing on Windows - people will instead use |
|
There may not be XDG_* env vars on windows, but the default XDG cache dir is Put simply, if we agree that allowing users to configure where the node-gyp dir is (and I think that's evident with the assumption that |
|
sounds good On Mon, Feb 8, 2016 at 9:15 AM, Ben Noordhuis [email protected]
|
|
Closing, superseded by #916 which landed earlier today. |
|
Is there a reason why it seems that #916 declined to go with:
I saw some discussion about Windows but that doesn't seem like a good reason to ignore the Unix platform's XDG preferences, for those who went through the trouble of setting the environment variable. UPDATE: looks like per this comment this may be handled in a later PR Is there an easy way for me to make use of the --dev-dir flag, as just a user of node? |
Potential fix for issue #21 that adds ability to use a flag called
--dev-dir, and a check forXDG_CACHE_DIRbeforeHOME.The
--dev-dirflag is the be-all-end-all result. If this flag is not used, then the application looks forXDG_CACHE_DIRfirst, thenHOME, thenUSERPROFILEas it used to.