bitranox / igittigitt

A spec-compliant gitignore parser for Python
MIT License
24 stars 6 forks source link

Match ignore file with different base paths? #30

Closed omid3098 closed 11 months ago

omid3098 commented 11 months ago

I want to process all files and subdirectories in a given directory and match them with ignore file. For example, My project is located in: D:\project The ignore file is located in D:\project\.ignore and contains *.txt I am trying to pass a system wide file path or directory to check if they match or not. like c:\myfile.txt All files and directories are not matched if the basepath is not the same. Is it even possible to do something like this?

bitranox commented 11 months ago

this is perfectly possible - You can read your file D:\project\.ignore and add each rule line by line by function add_rule with a new base_path