mirror of
https://github.com/OpenNebula/one.git
synced 2024-12-23 17:33:56 +03:00
feature #661: Select editor for update actions
This commit is contained in:
parent
bef0fddeac
commit
088dc7ff2a
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user