diff --git a/helper/audio-helper.rb b/helper/audio-helper.rb index a57c43a..0868496 100644 --- a/helper/audio-helper.rb +++ b/helper/audio-helper.rb @@ -35,7 +35,7 @@ def self.extract(file_name, save_dir) end no_ext_filename = File.basename(file_name, File.extname(file_name)) output_file_path = File.join(save_dir, "#{no_ext_filename}.#{output_extension}") - escaped_output_file_path = Shellwords.escape(output_file_path) + escaped_output_file_path = UtilityHelper.make_shellsafe_path(output_file_path) if File.exist?(output_file_path) puts "Audio file seems to exist already, removing it before extraction." File.delete(output_file_path) diff --git a/helper/utility-helper.rb b/helper/utility-helper.rb index 34ea3b4..5d9256f 100644 --- a/helper/utility-helper.rb +++ b/helper/utility-helper.rb @@ -41,7 +41,7 @@ def self.jruby? def self.make_shellsafe_path(path) # JRuby cannot open some paths that are escaped with Shellwords.escape so this is a workaround. - if jruby? + if jruby? || windows? '"' + path + '"' else Shellwords.escape(path)