1
0
Fork 0

Use default editors if EDITOR is not set, improve windows compatibility

pull/1032/merge
Jordi Boggiano 2012-10-07 15:48:50 +02:00
parent 0615455087
commit d00d7eef7f
1 changed files with 7 additions and 3 deletions

View File

@ -115,9 +115,13 @@ EOT
{
// Open file in editor
if ($input->getOption('editor')) {
// @todo Find a way to use another editor
$editor = system("bash -cl 'echo \$EDITOR'");
system($editor . ' ' . $this->configFile->getPath() . ' > `tty`');
$editor = getenv('EDITOR');
if (!$editor) {
$editor = defined('PHP_WINDOWS_VERSION_BUILD') ? 'notepad' : 'vi';
}
system($editor . ' ' . $this->configFile->getPath() . (defined('PHP_WINDOWS_VERSION_BUILD') ? '': ' > `tty`'));
return 0;
}