feature #661: Select editor for update actions

This commit is contained in:
Daniel Molina committed 2011-06-13 16:17:00 +02:00
1 parent bef0fddeac
commit 088dc7ff2a
1 file changed
+9 -2
+9 -2
View File
@@ -35,6 +35,8 @@ EOT
TABLE_CONF_PATH="/etc/one/cli"
end
EDITOR_PATH='/usr/bin/vi'
########################################################################
# Options
########################################################################
@@ -311,8 +313,13 @@ EOT
tmp << resource.template_str
tmp.flush
# TBD select editor
system("vim #{path}")
editor_path = ENV["EDITOR"] ? ENV["EDITOR"] : EDITOR_PATH
system("#{editor_path} #{path}")
unless $?==0
puts "Editor not defined"
exit -1
end
tmp.close
str = File.read(path)