Skip to content
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

[FIX] Implement Custom Directory Tree Method #53

Merged
merged 3 commits into from
Sep 25, 2023

Conversation

eli64s
Copy link
Owner

@eli64s eli64s commented Sep 25, 2023

The README's directory tree is now generated using pure Python.

  • Removes dependency on the tree command keeping it native to Python
  • Improves security by removing the subprocess module.

In the original implementation, if the desired executable path is not fully qualified relative to the filesystem root then this may present a potential security risk.

def run_tree_command(repo_path: Path) -> str:
    """Executes the 'tree' command to generate a directory tree."""
    tree_bytes = subprocess.check_output(["tree", "-n", repo_path])

More details on this can be found here


@eli64s eli64s added bug Something isn't working enhancement New feature or request labels Sep 25, 2023
@eli64s eli64s merged commit bbd7e63 into main Sep 25, 2023
1 check passed
@eli64s eli64s deleted the bugfix/remove-subproces-tree branch September 25, 2023 13:45
@eli64s eli64s added security and removed enhancement New feature or request labels Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working security
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant