some install fixes

This commit is contained in:
payonel 2017-06-25 23:31:30 -07:00
parent c988b44f66
commit e57d763f3a
2 changed files with 5 additions and 4 deletions

View File

@ -64,7 +64,7 @@ local targets = {}
local devices = {} local devices = {}
for dev, path in fs.mounts() do for dev, path in fs.mounts() do
devices[dev] = path devices[dev] = devices[dev] and #devices[dev] < #path and devices[dev] or path
end end
devices[fs.get("/dev/") or false] = nil devices[fs.get("/dev/") or false] = nil
@ -81,6 +81,7 @@ for dev, path in pairs(devices) do
os.exit(1) os.exit(1)
end end
elseif specified or elseif specified or
not (source_filter and address:find(source_filter, 1, true) == 1) and -- specified for source
not target_filter and not target_filter and
address ~= tmpAddress then address ~= tmpAddress then
table.insert(targets, {dev=dev, path=install_path, specified=specified}) table.insert(targets, {dev=dev, path=install_path, specified=specified})
@ -156,8 +157,8 @@ local cp_args =
local source_display = options.label or source.dev.getLabel() or source.path local source_display = options.label or source.dev.getLabel() or source.path
local special_target = "" local special_target = ""
if #targets > 1 or target_filter then if #targets > 1 or target_filter or source_filter then
special_target = " to " .. cp_args[3] special_target = " to " .. cp_args[4]
end end
io.write("Install " .. source_display .. special_target .. "? [Y/n] ") io.write("Install " .. source_display .. special_target .. "? [Y/n] ")

View File

@ -13,7 +13,7 @@ local function select_prompt(devs, prompt)
for i = 1, num_devs do for i = 1, num_devs do
local src = devs[i] local src = devs[i]
local dev = src.dev local dev = src.dev
local selection_label = src.prop.label or dev.getLabel() local selection_label = (src.prop or {}).label or dev.getLabel()
if selection_label then if selection_label then
selection_label = string.format("%s (%s...)", selection_label, dev.address:sub(1, 8)) selection_label = string.format("%s (%s...)", selection_label, dev.address:sub(1, 8))
else else