Skip to content

Latest commit

 

History

History
63 lines (45 loc) · 1.89 KB

README.md

File metadata and controls

63 lines (45 loc) · 1.89 KB

Whicher

Maven Central license

which -- locate a program file in the user's path

This class basically does what the which program does.

Usage

Kotlin

import guru.drako.utils.which.Whicher

// in some fun:
val location = Whicher.which("foo")
// location contains path to foo executable (e.g. "/usr/bin/foo")
// which returns a Path?, so null is returned when the executable is not found

Java

import guru.drako.utils.which.Whicher;
import java.nio.Path;

// in some function:
final Path location = Whicher.system.which("foo");
// location contains path to foo executable (e.g. "/usr/bin/foo")
// which returns null when the executable is not found

The Whicher does not depend on the which program and might do some things differently.

Setup

Maven

<dependency>
    <groupId>guru.drako.utils</groupId>
    <artifactId>whicher</artifactId>
    <version>1.2</version>
</dependency>

Gradle

dependencies {
    compile 'guru.drako.utils:whicher:1.2'
}

Build/Test Status

Branch Travis CI Status AppVeyor Status
develop Build Status Build status
master Build Status Build status