https://github.com/ul/project-root
A small utility to find project root.
https://github.com/ul/project-root
cli rust rust-lang
Last synced: about 1 year ago
JSON representation
A small utility to find project root.
- Host: GitHub
- URL: https://github.com/ul/project-root
- Owner: ul
- Created: 2019-04-21T22:18:18.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-04-21T22:23:15.000Z (about 7 years ago)
- Last Synced: 2025-04-04T12:07:32.209Z (about 1 year ago)
- Topics: cli, rust, rust-lang
- Language: Rust
- Size: 1.95 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# project-root
A small utility to find project root.
## Installation
```
$ cargo install --force --git https://github.com/ul/project-root.git
```
## Usage
```
$ project-root ...
```
where `...` is project root markers in priority order. Search starts from the current
directory. When successful, `project-root` will print the path to the project root. Otherwise it
will just exit with the error code 1.
For example
```
$ project-root lerna.json package.json .git
```
will try to find `lerna.json` while traversing up to the filesystem root in case current directory
is inside of a Lerna-managed monorepo. If it fails, `project-root` will test for `package.json` then
if it's a regular npm package. And as the last resort it will try to find Git repository root.