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

Add --exlcude option #114

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add --exlcude option #114

wants to merge 1 commit into from

Conversation

andras-kth
Copy link

@andras-kth andras-kth commented Aug 24, 2021

I happen to have an index.html in my PACKAGE_DIR and get the following

user@host$ dir2pi .
Traceback (most recent call last):
  File "/opt/homebrew/bin/dir2pi", line 8, in <module>
    sys.exit(dir2pi())
  File "/opt/homebrew/lib/python3.8/site-packages/libpip2pi/commands.py", line 312, in dir2pi
    return _dir2pi(option, argv)
  File "/opt/homebrew/lib/python3.8/site-packages/libpip2pi/commands.py", line 356, in _dir2pi
    pkg_name, pkg_rest = file_to_package(pkg_basename, pkgdir)
  File "/opt/homebrew/lib/python3.8/site-packages/libpip2pi/commands.py", line 159, in file_to_package
    raise InvalidFilePackageName(file, basedir)
libpip2pi.commands.InvalidFilePackageName: unexpected file name: 'index.html' (not in 'pkg-name-version.xxx' format; found in directory: '.')
user@host$

With this PR applied, I can exclude the non-package content:

user@host$ dir2pi -X *.html .
user@host$

This may also resolve #68 and #69 in a more disciplined manner.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant