Skip to content

Commit

Permalink
Put current lilypond version in wrapper file
Browse files Browse the repository at this point in the history
Get rid of Lilypond warning about missing version
  • Loading branch information
noteflakes committed Nov 30, 2016
1 parent c4a1381 commit 27dbc40
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/lyp/lilypond.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'."
Expand Down Expand Up @@ -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$/
Expand Down
6 changes: 6 additions & 0 deletions lib/lyp/templates/deps_wrapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
# }
# }

if _[:opts][:lilypond_version]
`
\version "{{_[:opts][:lilypond_version]}}"
`
end

require 'fileutils'

user_filename = File.expand_path(_[:user_file])
Expand Down

0 comments on commit 27dbc40

Please sign in to comment.