mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-31 18:44:27 +02:00
Include hidden files by default in a package
This commit is contained in:
@@ -26,7 +26,14 @@ from platformio.unpacker import FileUnpacker
|
||||
|
||||
|
||||
class PackagePacker(object):
|
||||
EXCLUDE_DEFAULT = ["._*", ".DS_Store", ".git", ".hg", ".svn", ".pio"]
|
||||
EXCLUDE_DEFAULT = [
|
||||
"._*",
|
||||
".DS_Store",
|
||||
".git",
|
||||
".hg",
|
||||
".svn",
|
||||
".pio",
|
||||
]
|
||||
INCLUDE_DEFAULT = ManifestFileType.items().values()
|
||||
|
||||
def __init__(self, package, manifest_uri=None):
|
||||
@@ -116,7 +123,7 @@ class PackagePacker(object):
|
||||
return dst
|
||||
|
||||
def compute_src_filters(self, include, exclude):
|
||||
result = ["+<%s>" % p for p in include or ["*"]]
|
||||
result = ["+<%s>" % p for p in include or ["*", ".*"]]
|
||||
result += ["-<%s>" % p for p in exclude or []]
|
||||
result += ["-<%s>" % p for p in self.EXCLUDE_DEFAULT]
|
||||
# automatically include manifests
|
||||
|
@@ -26,6 +26,9 @@ from platformio.package.pack import PackagePacker
|
||||
|
||||
def test_base(tmpdir_factory):
|
||||
pkg_dir = tmpdir_factory.mktemp("package")
|
||||
pkg_dir.join(".git").mkdir().join("file").write("")
|
||||
pkg_dir.join(".gitignore").write("tests")
|
||||
pkg_dir.join("._ignored").write("")
|
||||
pkg_dir.join("main.cpp").write("#include <stdio.h>")
|
||||
p = PackagePacker(str(pkg_dir))
|
||||
# test missed manifest
|
||||
@@ -38,7 +41,7 @@ def test_base(tmpdir_factory):
|
||||
p.pack()
|
||||
with tarfile.open(os.path.join(str(pkg_dir), "foo-1.0.0.tar.gz"), "r:gz") as tar:
|
||||
assert set(tar.getnames()) == set(
|
||||
["include/main.h", "library.json", "main.cpp"]
|
||||
[".gitignore", "include/main.h", "library.json", "main.cpp"]
|
||||
)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user