which

Version, currently master branch1 version
  • master branchlatestFeb 5, 2020

github.com/dscottboggs/which.cr

Adds the which command to crystal code.

0 stars
0 dependents
License: MIT

Installation

# Add this to your shard.yml
dependencies:
  which:
    github: dscottboggs/which.cr
    branch: master

master is a branch, not a release, so this tracks it rather than pinning a version.

Then run:

shards install

shard.yml

Crystal
0.32.1
License
MIT
Author
D. Scott Boggs

Dependencies

This version declares no dependencies.

README

which.cr

Adds the which command to Crystal code.

That is, when given an executable name, returns the absolute path to the executable.

Installation

  1. Add the dependency to your shard.yml:

    dependencies:
      which.cr:
        github: dscottboggs/which.cr
  2. 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

  1. Fork it (https://github.com/dscottboggs/which.cr/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors