Compare commits

...

3 Commits

1 changed files with 2 additions and 1 deletions

3
dup.rb
View File

@ -28,6 +28,7 @@ MAPPINGS = [
['labels', '--label', lambda{|c,i| l=Hash[c.Config.Labels.to_h.delete_if{|k,v| i.Config.Labels[k]==v rescue false}.map{|k,v| [k.to_s, v]}] ; l}],
['hostname', '--hostname'],
['working_dir', '--workdir', lambda{|c,i| (wd=c.Config.WorkingDir) == i.Config.WorkingDir ? nil : wd}],
['init', '--init', lambda{|c,i| c.Config.Init}, {:type=>:switch}],
['image', nil, lambda{|c,i| c.Config.Image}],
['command', nil, lambda{|c,i| (cmd=c.Config.Cmd.join(" ") rescue nil) == (i.Config.Cmd.join(" ") rescue nil)? nil : cmd}, {:escape=>false}]
]
@ -137,7 +138,7 @@ def action_create(container, file)
File.open(file, "w") {|f| f.write(get_sample(container))}
exec("joe #{file.shellescape}")
exec("/usr/bin/editor #{file.shellescape}")
exit 1 # will never be reached because exec replaces this process. But just in case... ;-)
end