这是indexloc提供的服务,不要输入任何密码
Skip to content

depending on "*" should match everything #855

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion cli/internal/context/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ func isWorkspaceReference(packageVersion string, dependencyVersion string, cwd s
} else if isProtocolExternal(protocol) {
// Other protocols are assumed to be external references ("github:", "link:", "file:" etc)
return false
}
} else if dependencyVersion == "*" {
return true
}

// If we got this far, then we need to check the workspace package version to see it satisfies
// the dependencies range to determin whether or not its an internal or external dependency.
Expand Down
6 changes: 6 additions & 0 deletions cli/internal/context/context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ func Test_isWorkspaceReference(t *testing.T) {
dependencyVersion: "file:../../../otherproject",
want: false, // this is not within the repo root
},
{
name: "handles development versions",
packageVersion: "0.0.0-development",
dependencyVersion: "*",
want: true, // "*" should always match
},
}

for _, tt := range tests {
Expand Down