Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion helper/audio-helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion helper/utility-helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down