Skip to content

Commit b8b51cf

Browse files
committed
fix(adapter): add support for scoped adapters
Previously adapters would fail if they were private because they would be interpreted as paths. This fixes that issue by treating anything with @ at the beginning of the string as a node module. Closes #403
1 parent 27fb1ae commit b8b51cf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/commitizen/adapter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ function getPrompter(adapterPath) {
128128
function resolveAdapterPath(inboundAdapterPath) {
129129
// Check if inboundAdapterPath is a path or node module name
130130
let parsed = path.parse(inboundAdapterPath);
131-
let isPath = parsed.dir.length > 0;
131+
let isPath = parsed.dir.length > 0 && parsed.dir.charAt(0) !== "@";
132132

133133
// Resolve from the root of the git repo if inboundAdapterPath is a path
134134
let absoluteAdapterPath = isPath ?

0 commit comments

Comments
 (0)