Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit 506f5be

Browse files
author
Alan Shaw
authored
fix: path to cid-tool commands (#1866)
In the edge case where IPFS is a dependency of a project and the user attempts to use the IPFS CLI, the cid-tool will not be installed at `proj/node_modules/ipfs/node_modules/cid-tool` but will instead be flattened by npm and installed at `proj/node_modules/cid-tool`. i.e. next to `ipfs` in the dependency tree instead of a child of. This PR fixes this situation by using `require.resolve` to get the path to the `cid-tool` instead of assuming where it is installed. License: MIT Signed-off-by: Alan Shaw <[email protected]>
1 parent 7533d76 commit 506f5be

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/cli/commands/cid.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
const path = require('path')
44

55
const cidCommandsPath = path.join(
6-
__dirname, '..', '..', '..', 'node_modules', 'cid-tool', 'src', 'cli', 'commands'
6+
path.dirname(require.resolve('cid-tool')), 'cli', 'commands'
77
)
88

99
module.exports = {

0 commit comments

Comments
 (0)