which.cr
Adds the which
command to Crystal code.
That is, when given an executable name, returns the absolute path to the executable.
Installation
-
Add the dependency to your
shard.yml
:dependencies: which.cr: github: dscottboggs/which.cr
-
Run
shards install
Usage
require "which"
which "bash" # => Path["/bin/bash"]
which? "fake-command" # => nil
Development
Optimization or cross-platform suggestions are welcome. Feel free to open a pull request or issue.
Contributing
- Fork it (https://github.com/dscottboggs/which.cr/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
Contributors
- D. Scott Boggs - creator and maintainer