Skip to content

Commit

Permalink
feat: update version to 9.0.19 and change release date to 6/Sep/2024
Browse files Browse the repository at this point in the history
fix: add checks for app name and existence in get_appstore_dict method
style: remove unused variable ret in get_appstore_dict method
  • Loading branch information
rcmdnk committed Sep 6, 2024
1 parent 2c762a3 commit f98bb7d
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
12 changes: 9 additions & 3 deletions bin/brew-file
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ __author__ = "rcmdnk"
__copyright__ = "Copyright (c) 2013 rcmdnk"
__credits__ = ["rcmdnk"]
__license__ = "MIT"
__version__ = "9.0.18"
__date__ = "4/Sep/2024"
__version__ = "9.0.19"
__date__ = "6/Sep/2024"
__maintainer__ = "rcmdnk"
__email__ = "rcmdnk@gmail.com"
__status__ = "Prototype"
Expand Down Expand Up @@ -1896,12 +1896,18 @@ class BrewFile:

def get_appstore_dict(self) -> dict[str, list[str]]:
apps: dict[str, list[str]] = {}
ret, apps_tmp = self.helper.proc(
_, apps_tmp = self.helper.proc(
"mdfind 'kMDItemAppStoreHasReceipt=1'",
print_cmd=False,
print_out=False,
)
for a in apps_tmp:
if not a.endswith(".app"):
self.log.warning(f"Incorrect app name in mdfind: {a}")
continue
if not Path(a).is_dir():
self.log.warning(f"App doesn't exist: {a}")
continue
_, lines = self.helper.proc(
f"mdls -attr kMDItemAppStoreAdamID -attr kMDItemVersion '{a}'",
print_cmd=False,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "brew-file"
version = "9.0.18"
version = "9.0.19"
description = "Brewfile manager for Homebrew"
authors = ["rcmdnk <rcmdnk@gmail.com>"]

Expand Down
8 changes: 7 additions & 1 deletion src/brew_file/brew_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -883,12 +883,18 @@ def check_mas_cmd(self, force: bool = False) -> Literal[-2, -1, 0, 1]:

def get_appstore_dict(self) -> dict[str, list[str]]:
apps: dict[str, list[str]] = {}
ret, apps_tmp = self.helper.proc(
_, apps_tmp = self.helper.proc(
"mdfind 'kMDItemAppStoreHasReceipt=1'",
print_cmd=False,
print_out=False,
)
for a in apps_tmp:
if not a.endswith(".app"):
self.log.warning(f"Incorrect app name in mdfind: {a}")
continue
if not Path(a).is_dir():
self.log.warning(f"App doesn't exist: {a}")
continue
_, lines = self.helper.proc(
f"mdls -attr kMDItemAppStoreAdamID -attr kMDItemVersion '{a}'",
print_cmd=False,
Expand Down
4 changes: 2 additions & 2 deletions src/brew_file/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
__copyright__ = "Copyright (c) 2013 rcmdnk"
__credits__ = ["rcmdnk"]
__license__ = "MIT"
__version__ = "9.0.18"
__date__ = "4/Sep/2024"
__version__ = "9.0.19"
__date__ = "6/Sep/2024"
__maintainer__ = "rcmdnk"
__email__ = "rcmdnk@gmail.com"
__status__ = "Prototype"

0 comments on commit f98bb7d

Please sign in to comment.