Page MenuHomePhorge

get-cargo-path.js
No OneTemporary

Size
458 B
Referenced Files
None
Subscribers
None

get-cargo-path.js

/* eslint-disable flowtype/require-valid-file-annotation */
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:30 PM (1 d, 3 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5599483
Default Alt Text
get-cargo-path.js (458 B)

Event Timeline