Skip to content

Add --exlcude option#114

Open
andras-kth wants to merge 1 commit intowolever:masterfrom
andras-kth:master
Open

Add --exlcude option#114
andras-kth wants to merge 1 commit intowolever:masterfrom
andras-kth:master

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