kopia lustrzana https://github.com/jupyterhub/repo2docker
fix: create src directory in any case
The original behavior was to create an src directory with the content of the repository. The creation would happen in any case (remote or local repository). With the filtering in place and the default to remove the .git folder, it breaks the build as the src folder can be missing. This patch ensures that the directory is present in the tar so the build can continue as it did until now.pull/1205/head
rodzic
6b8b2334e7
commit
3028d07182
|
@ -627,8 +627,17 @@ class BuildPack:
|
|||
if not exclude:
|
||||
exclude = ["**/.git"]
|
||||
|
||||
for item in exclude_paths(".", exclude):
|
||||
tar.add(item, f"src/{item}", filter=_filter_tar)
|
||||
files_to_add = exclude_paths(".", exclude)
|
||||
|
||||
if files_to_add:
|
||||
for item in files_to_add:
|
||||
tar.add(item, f"src/{item}", filter=_filter_tar)
|
||||
else:
|
||||
# Either the source was empty or everything was filtered out.
|
||||
# In any case, create an src dir so the build can proceed.
|
||||
src = tarfile.TarInfo("src")
|
||||
src.type = tarfile.DIRTYPE
|
||||
tar.addfile(src)
|
||||
|
||||
tar.close()
|
||||
tarf.seek(0)
|
||||
|
|
Ładowanie…
Reference in New Issue