Skip to content

Exclude listing pages.en/ when using scripts/set-alias-page.py while dry-running #18653

@dmmqz

Description

@dmmqz

While creating the alias page for gh a11y, I noticed that pages.en/ was listed when dry-running. So the output was:

pages/common/gh-a11y.md page would be added
pages.en/common/gh-a11y.md page would be added

The problem with this is pages.en/ is a symlink to pages/. This problem can be solved by checking if the directory is a symlink in the following line:

return [d for d in root.iterdir() if d.name.startswith("pages")]

So this could be changed to:

return [d for d in root.iterdir() if d.name.startswith("pages") and not d.is_symlink()]

If others are in agreement, I'll open a PR to fix this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    toolingHelper tools, scripts and automated processes.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions