Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for making the audio extraction work on windows #109

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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