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"
|
TABLE_CONF_PATH="/etc/one/cli"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
EDITOR_PATH='/usr/bin/vi'
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
# Options
|
# Options
|
||||||
########################################################################
|
########################################################################
|
||||||
@ -311,8 +313,13 @@ EOT
|
|||||||
tmp << resource.template_str
|
tmp << resource.template_str
|
||||||
tmp.flush
|
tmp.flush
|
||||||
|
|
||||||
# TBD select editor
|
editor_path = ENV["EDITOR"] ? ENV["EDITOR"] : EDITOR_PATH
|
||||||
system("vim #{path}")
|
system("#{editor_path} #{path}")
|
||||||
|
unless $?==0
|
||||||
|
puts "Editor not defined"
|
||||||
|
exit -1
|
||||||
|
end
|
||||||
|
|
||||||
tmp.close
|
tmp.close
|
||||||
|
|
||||||
str = File.read(path)
|
str = File.read(path)
|
||||||
|
Loading…
Reference in New Issue
Block a user