Skip to content

Commit

Permalink
Merge pull request #105 from fredericksgary/master
Browse files Browse the repository at this point in the history
Pick executables deterministically and warn when doing so
  • Loading branch information
BanzaiMan committed Jan 31, 2013
2 parents 7a7b62b + d2fbbdb commit e5e41e8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/warbler/traits/gemspec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def default_executable
if !@spec.executables.empty?
"bin/#{@spec.executables.first}"
else
exe = Dir['bin/*'].first
exe = Dir['bin/*'].sort.first
raise "No executable script found" unless exe
warn "No default executable found in #{@spec_file}, using #{exe}"
exe
Expand Down
9 changes: 7 additions & 2 deletions lib/warbler/traits/nogemspec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,13 @@ def update_archive(jar)
end

def default_executable
exes = Dir['bin/*']
exe = exes.grep(/#{config.jar_name}/).first || exes.first
exes = Dir['bin/*'].sort
unless(exe = exes.grep(/#{config.jar_name}/).first)
exe = exes.first
if exe
warn "No executable matching config.jar_name found, using #{exe}"
end
end
raise "No executable script found" unless exe
exe
end
Expand Down

0 comments on commit e5e41e8

Please sign in to comment.