Skip to content

Commit

Permalink
maixtool support windows like path in app.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
Neutree committed Jan 7, 2025
1 parent 10b0f2d commit 4908c79
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
13 changes: 11 additions & 2 deletions tools/maixtool/maixtool/app_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def get_files(project_path, exclude = [], black_list = []):
continue
valid = True
for e in exclude:
e = e.replace("\\", "/")
if e == path or path.startswith(e + "/"):
valid = False
break
Expand Down Expand Up @@ -96,6 +97,12 @@ def check_icon_file(files, icon):
if not found:
raise FileNotFoundError("icon file {} not found in files".format(icon))

def check_update_files(files):
final = {}
for k, v in files.items():
final[k.replace("\\", "/")] = v.replace("\\", "/")
return final

def pack(project_path, bin_path="main.py", extra_files = {}):
'''
Find main.py and app.yaml in current directory, pack to dist/app_id_vx.x.x.zip,
Expand Down Expand Up @@ -138,11 +145,13 @@ def pack(project_path, bin_path="main.py", extra_files = {}):
bin_name = app_id
app_info["files"][bin_path] = bin_name
app_info["files"][app_yaml] = app_yaml
app_info["files"] = check_update_files(app_info["files"])
extra_files = check_update_files(extra_files)
app_info["files"].update(extra_files)
icon = app_info.get("icon", "")
icon = app_info.get("icon", "").replace("\\", "/")
if icon and icon not in app_info["files"]:
app_info["files"][icon] = icon
check_icon_file(app_info["files"], app_info.get("icon", ""))
check_icon_file(app_info["files"], icon)
copy_files(app_info["files"], project_path, temp_dir)
# zip
version_str = "_v" + app_info["version"]
Expand Down
2 changes: 1 addition & 1 deletion tools/maixtool/maixtool/version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@


__version__ = "1.4.2"
__version__ = "1.4.4"

0 comments on commit 4908c79

Please sign in to comment.