Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32159370
get-cargo-path.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
458 B
Referenced Files
None
Subscribers
None
get-cargo-path.js
View Options
/* 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
Details
Attached
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)
Attached To
Mode
rCOMM Comm
Attached
Detach File
Event Timeline
Log In to Comment