Skip to content

Commit

Permalink
Bug fix package (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-jhollan authored Apr 24, 2023
1 parent b93d812 commit 83d8e52
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 21 deletions.
2 changes: 1 addition & 1 deletion src/snowcli/__about__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from __future__ import annotations

VERSION = "0.2.7"
VERSION = "0.2.8"
42 changes: 22 additions & 20 deletions src/snowcli/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,16 +423,17 @@ def recursiveZipPackagesDir(pack_dir: str, dest_zip: str) -> bool:
):
zipf.write(os.path.relpath(file))

for dir_path in os.getenv("SNOWCLI_INCLUDE_PATHS", "").split(":"):
directory = pathlib.Path(dir_path)
if directory.is_dir():
for file in pathlib.Path(directory).glob("**/*"):
if (
not str(file).startswith(".")
and not file.match("*.pyc")
and not file.match("*__pycache__*")
):
zipf.write(file, arcname=os.path.relpath(file, directory))
if os.getenv("SNOWCLI_INCLUDE_PATHS") is not None:
for dir_path in os.getenv("SNOWCLI_INCLUDE_PATHS", "").split(":"):
directory = pathlib.Path(dir_path)
if directory.is_dir():
for file in pathlib.Path(directory).glob("**/*"):
if (
not str(file).startswith(".")
and not file.match("*.pyc")
and not file.match("*__pycache__*")
):
zipf.write(file, arcname=os.path.relpath(file, directory))

# close the zip file object
zipf.close()
Expand All @@ -445,16 +446,17 @@ def standardZipDir(dest_zip: str) -> bool:
if not file.match(".*"):
zipf.write(os.path.relpath(file))

for dir_path in os.getenv("SNOWCLI_INCLUDE_PATHS", "").split(":"):
directory = pathlib.Path(dir_path)
if directory.is_dir():
for file in pathlib.Path(directory).glob("**/*"):
if (
not str(file).startswith(".")
and not file.match("*.pyc")
and not file.match("*__pycache__*")
):
zipf.write(file, arcname=os.path.relpath(file, directory))
if os.getenv("SNOWCLI_INCLUDE_PATHS") is not None:
for dir_path in os.getenv("SNOWCLI_INCLUDE_PATHS", "").split(":"):
directory = pathlib.Path(dir_path)
if directory.is_dir():
for file in pathlib.Path(directory).glob("**/*"):
if (
not str(file).startswith(".")
and not file.match("*.pyc")
and not file.match("*__pycache__*")
):
zipf.write(file, arcname=os.path.relpath(file, directory))

# close the zip file object
zipf.close()
Expand Down

0 comments on commit 83d8e52

Please sign in to comment.