Skip to content

Issue with tree command on Windows #26

@qchapp

Description

@qchapp

Since I wasn't able to get any output on Windows, I had to modify the run_tree_command function as follows to make it work:

import platform

def run_tree_command(path: str) -> str:
    """Run the tree command and return its output."""
    if platform.system() == "Windows":
        cmd = ["cmd", "/c", "tree", "/a", "/f", path]
    else:
        cmd = ["tree", "-a", "-f", "--noreport", path]

    result = subprocess.run(
        cmd,
        stdout=subprocess.PIPE,
        stderr=subprocess.PIPE,
        text=True,
        check=True
    )
    return result.stdout

I'm not sure if the issue is on my end, so I'm just leaving this here!
Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions