Skip to content
This repository has been archived by the owner on Aug 11, 2021. It is now read-only.

Allow users to set a custom editor env variable #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kelsin
Copy link

@kelsin kelsin commented Nov 22, 2014

Many programs allow a custom editor variable to override EDITOR. Now users can
set that on osenv with the following code:

var osenv = require('osenv')
osenv.setCustomEditorVariable('MY_EDITOR')

var editor = osenv.editor()

If the MY_EDITOR environment variable is set, it will be used. Otherwise we
follow the same rules that osenv has used before.

One confusing point is that if you set the custom editor variable after calling
.editor() the previous result will be cached and this will have no effect.

Many programs allow a custom editor variable to override EDITOR. Now users can
set that on osenv with the following code:

    var osenv = require('osenv')
    osenv.setCustomEditorVariable('MY_EDITOR')

    var editor = osenv.editor()

If the MY_EDITOR environment variable is set, it will be used. Otherwise we
follow the same rules that osenv has used before.

One confusing point is that if you set the custom editor variable after calling
.editor() the previous result will be cached and this will have no effect.
@zkat
Copy link

zkat commented Oct 30, 2015

Do you have a particular need or use-case for this?

In general, osenv is meant to be a very small abstraction layer over cross-platform environment stuff, and features like these don't seem like they would belong with that stated purpose.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants