||dir-pattern file-pattern1 [file-patternN]||✔ dir pattern
✘ file patterns
The order of the commands in your template file matters. I recommend doing includes first, then excludes, going from most specific to most general.
Remember: You only need to exclude files get added to the list by default or
*with your include commands -- *you do not need to fully mirror your
.gitignore with exclude commands.
If a pattern is anchored that means it must match the root of the project precisely. For example, given these files:
. ├── LICENSE.txt └── things └── LICENSE.txt
- The command
include LICENSE.txtwould add
- The command
global-include LICENSE.txtwould add any
LICENSE.txtfound in the tree.
Thus you want to be certain to use a
global-exclude to keep out unwanted
files that get strewn about everywhere:
global-exclude *.py[cod] global-exclude .DS_Store
Shell-style glob patterns
||Match 0 or more anything but a path seperator, e.g.
||Match 1 of anything but a path seperator, e.g.
||Match anything, including path seperators.||
||Match any character within; ranges are valid.||
||Match anything except a character within; ranges are valid.||
Note: Older versions of Python did not support the globstar (
**). While it is a wonderful addition in newer version of Python and
setuptools, it can still take some playing with to get the result you want, particularly with
- Leading and trailing whitespace are irrelevant.
- Comments are an
#not escaped with a
\#would not start a comment.
- Lines can be continued using a
An example of some syntax is useful:
include LICENSE.txt # If you need a literal special glob character, put it in a sequence. include myfile[?].txt # To match a literal hash, escape it. include my\#file.txt graft docs global-exclude \ *.py[cod] \ # Comments after line continuations are valid. # And between line continuations as well! .DS_Store \ # Last item can have a line continuation as well, as long as the next line is blank. prune docs/build
For a real-world example, have a look at the included
set -gx VSCE_TOKEN "<token from 1Password>" set -gx OVSX_TOKEN "<token from 1Password>" set -gx PCKG_VERSION "v1.0.1" pew workon vscode-python-manifest-template # Probably already done. npm i -g vsce ovsx vsce login benspaulding # Good to review. vsce ls # Should do before running publish, just to be safe. vsce package # Bump version number in package.json. git add package.json git commit -m "Bump version for $PCKG_VERSION" git tag -a -m "vscode-python-manifest-template extension $PCKG_VERSION" "$PCKG_VERSION" git push git push --tags git fetch --all # Because of my multi-push setup. # And publish! vsce publish --githubBranch "main" -p "$VSCE_TOKEN" ovsx publish --baseImagesUrl "https://github.com/benspaulding/vscode-python-manifest-template/raw/main/" -p "$OVSX_TOKEN"