diff --git a/lib/lyp/lilypond.rb b/lib/lyp/lilypond.rb index ee70856..1c71206 100644 --- a/lib/lyp/lilypond.rb +++ b/lib/lyp/lilypond.rb @@ -73,6 +73,9 @@ def select_lilypond_version(opts, file_path) end Lyp::Lilypond.check_lilypond! + + opts[:lilypond_version] = current_lilypond_version + Lyp::Lilypond.current_lilypond.tap do |path| unless path && File.file?(path) STDERR.puts "No version of lilypond found. To install lilypond run 'lyp install lilypond'." @@ -181,6 +184,7 @@ def force_version!(version) attr_reader :forced_version + # Make sure there's a default and current lilypond set def check_lilypond! path = default_lilypond select_default_lilypond! unless path && path =~ /lilypond$/ diff --git a/lib/lyp/templates/deps_wrapper.rb b/lib/lyp/templates/deps_wrapper.rb index ab0c66b..a5900b7 100644 --- a/lib/lyp/templates/deps_wrapper.rb +++ b/lib/lyp/templates/deps_wrapper.rb @@ -7,6 +7,12 @@ # } # } +if _[:opts][:lilypond_version] +` +\version "{{_[:opts][:lilypond_version]}}" +` +end + require 'fileutils' user_filename = File.expand_path(_[:user_file])