MCPcopy Create free account
hub / github.com/d1ll0n/stack-packer / tryFindHardhatProjectInPath

Function tryFindHardhatProjectInPath

src/project/hardhat.ts:46–57  ·  view source on GitHub ↗
(contractsPath?: string)

Source from the content-addressed store, hash-verified

44}
45
46const tryFindHardhatProjectInPath = (contractsPath?: string) => {
47 const contractsDirectory = contractsPath && findDirectoryInTree(contractsPath, 'contracts')
48 const {rootDirectory, hardhatConfigFile} = contractsDirectory ? getHardhatRootFromContracts(contractsDirectory) : {} as any;
49 if (rootDirectory && hardhatConfigFile && contractsDirectory) {
50 return {
51 contractsDirectory,
52 rootDirectory,
53 hardhatConfigFile
54 }
55 }
56 return undefined;
57}
58
59function tryFindHardhatDirectories(output?: string, input?: string) {
60 let projectDirs = output && tryFindHardhatProjectInPath(output);

Callers 1

Calls 2

findDirectoryInTreeFunction · 0.90

Tested by

no test coverage detected