mirror of https://github.com/astral-sh/uv
Escape glob patterns (#7709)
This commit is contained in:
parent
23b010c08f
commit
d536dfe67e
|
|
@ -637,8 +637,9 @@ impl Workspace {
|
||||||
|
|
||||||
// Add all other workspace members.
|
// Add all other workspace members.
|
||||||
for member_glob in workspace_definition.clone().members.unwrap_or_default() {
|
for member_glob in workspace_definition.clone().members.unwrap_or_default() {
|
||||||
let absolute_glob = workspace_root
|
let absolute_glob = PathBuf::from(glob::Pattern::escape(
|
||||||
.simplified()
|
workspace_root.simplified().to_string_lossy().as_ref(),
|
||||||
|
))
|
||||||
.join(member_glob.as_str())
|
.join(member_glob.as_str())
|
||||||
.to_string_lossy()
|
.to_string_lossy()
|
||||||
.to_string();
|
.to_string();
|
||||||
|
|
@ -1284,8 +1285,9 @@ fn is_excluded_from_workspace(
|
||||||
workspace: &ToolUvWorkspace,
|
workspace: &ToolUvWorkspace,
|
||||||
) -> Result<bool, WorkspaceError> {
|
) -> Result<bool, WorkspaceError> {
|
||||||
for exclude_glob in workspace.exclude.iter().flatten() {
|
for exclude_glob in workspace.exclude.iter().flatten() {
|
||||||
let absolute_glob = workspace_root
|
let absolute_glob = PathBuf::from(glob::Pattern::escape(
|
||||||
.simplified()
|
workspace_root.simplified().to_string_lossy().as_ref(),
|
||||||
|
))
|
||||||
.join(exclude_glob.as_str())
|
.join(exclude_glob.as_str())
|
||||||
.to_string_lossy()
|
.to_string_lossy()
|
||||||
.to_string();
|
.to_string();
|
||||||
|
|
@ -1309,8 +1311,9 @@ fn is_included_in_workspace(
|
||||||
workspace: &ToolUvWorkspace,
|
workspace: &ToolUvWorkspace,
|
||||||
) -> Result<bool, WorkspaceError> {
|
) -> Result<bool, WorkspaceError> {
|
||||||
for member_glob in workspace.members.iter().flatten() {
|
for member_glob in workspace.members.iter().flatten() {
|
||||||
let absolute_glob = workspace_root
|
let absolute_glob = PathBuf::from(glob::Pattern::escape(
|
||||||
.simplified()
|
workspace_root.simplified().to_string_lossy().as_ref(),
|
||||||
|
))
|
||||||
.join(member_glob.as_str())
|
.join(member_glob.as_str())
|
||||||
.to_string_lossy()
|
.to_string_lossy()
|
||||||
.to_string();
|
.to_string();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue