FMCorz / mdk

Moodle Development Kit. A collection of tools meant to make developers' lives easier.
GNU General Public License v3.0
85 stars 47 forks source link

Work out default editor on Mac OSX #95

Closed danpoltawski closed 9 years ago

danpoltawski commented 9 years ago

Unfortunately mdk can't work out my editor:

$ mdk doctor --dependencies
Checking dependencies
  Could not resolve the path to your editor

But git can:

$ git var GIT_EDITOR
vi

I don't have any environment variables set

$ echo $EDITOR $VISUAL

But, i'm sure mdk could do the same magic as git does, because i've never before had to set my editor and i'm on the CLI all the time.

danpoltawski commented 9 years ago

Hmm I wrote this issue expecting some hidden magic from git, but perhaps I am just benefiting from sensible defaults: https://github.com/git/git/blob/ce1d3a93a6405b8a0313491df3099919ed3d150f/editor.c#L10

FMCorz commented 9 years ago

https://github.com/FMCorz/mdk/blob/master/mdk/tools.py#L163

MDK makes 4 attempts to find the editor. Feel free to add whatever you think is missing there.

danpoltawski commented 9 years ago

(I saw that, when trying to debug why it couldn't find one :))

It seems like everything on OSX defaults back to vi, which would be my opinionated suggestion :D