Page MenuHomePhorge

get_cargo_path.js
No OneTemporary

Size
407 B
Referenced Files
None
Subscribers
None

get_cargo_path.js

// @flow
const findUp = require('find-up');
// finds the path to the parent directory containing a Cargo.toml file for the
// given path. Returns null if no Cargo.toml file is found.
function findRustProjectPath(path) {
const cargoTomlPath = findUp.sync('Cargo.toml', { cwd: path });
return cargoTomlPath ? cargoTomlPath.replace('/Cargo.toml', '') : null;
}
module.exports = { findRustProjectPath };

File Metadata

Mime Type
text/plain
Expires
Sun, Dec 7, 4:31 PM (1 d, 10 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5630146
Default Alt Text
get_cargo_path.js (407 B)

Event Timeline