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

Pick executables deterministically and warn when doing so #105

Merged
merged 1 commit into from Jan 31, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/warbler/traits/gemspec.rb
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
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