Simple library that helps to find path to a executable.
Add this to your application's shard.yml
:
dependencies:
find_binary:
github: DmitryBochkarev/find_binary-crystal
require "find_binary"
crystal = FindBinary.find("crystal")
if crystal.nil?
puts "crystal not found"
else
puts "crystal found: #{crystal}"
puts `#{crystal} -v`
end
You can provide an additional paths for the search.
build_in_binary = File.join(Dir.current, "vendor/ag")
find_the_silver_searcher = FindBinary.new("ag")
find_the_silver_searcher.append_path(build_in_binary)
silver_searcher = find_the_silver_searcher.find
puts "ag found: #{silver_searcher}"
puts `#{silver_searcher.not_nil!} --version`
- Fork it (https://github.com/DmitryBochkarev/find_binary-crystal/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
- Dmitry Bochkarev - creator, maintainer