mirror of https://github.com/captn3m0/muse-dl.git
Fix output-file flag when INPUT FILE is given
This commit is contained in:
parent
5ea33ef7b2
commit
923e589413
|
@ -20,8 +20,8 @@ module Muse::Dl
|
||||||
|
|
||||||
# If file exists and we can't clobber
|
# If file exists and we can't clobber
|
||||||
if File.exists?(parser.output) && parser.clobber == false
|
if File.exists?(parser.output) && parser.clobber == false
|
||||||
STDERR.puts "File already exists, not doing anything"
|
STDERR.puts "File already exists: #{parser.output}"
|
||||||
Process.exit(1)
|
return
|
||||||
end
|
end
|
||||||
temp_stitched_file = nil
|
temp_stitched_file = nil
|
||||||
pdf_builder = Pdftk.new(parser.tmp)
|
pdf_builder = Pdftk.new(parser.tmp)
|
||||||
|
@ -52,7 +52,10 @@ module Muse::Dl
|
||||||
input_list = parser.input_list
|
input_list = parser.input_list
|
||||||
if input_list
|
if input_list
|
||||||
File.each_line input_list do |url|
|
File.each_line input_list do |url|
|
||||||
|
# TODO: Change this to nil
|
||||||
|
parser.reset_output_file
|
||||||
parser.url = url.strip
|
parser.url = url.strip
|
||||||
|
# Ask the download process to not quit the process, and return instead
|
||||||
Main.dl parser
|
Main.dl parser
|
||||||
end
|
end
|
||||||
elsif parser.url
|
elsif parser.url
|
||||||
|
|
|
@ -22,6 +22,10 @@ module Muse::Dl
|
||||||
@output = output_file unless @output != DEFAULT_FILE_NAME
|
@output = output_file unless @output != DEFAULT_FILE_NAME
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def reset_output_file
|
||||||
|
@output = DEFAULT_FILE_NAME
|
||||||
|
end
|
||||||
|
|
||||||
def find_next(arg : Array(String), flag : String, default)
|
def find_next(arg : Array(String), flag : String, default)
|
||||||
search = arg.index flag
|
search = arg.index flag
|
||||||
if search
|
if search
|
||||||
|
|
Loading…
Reference in New Issue