Skip to content

Commit b6b2354

Browse files
committed
feat(updater): get package name
Signed-off-by: Me0wo <[email protected]>
1 parent 77a1161 commit b6b2354

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

Updater/updater/assets/__init__.py

Whitespace-only changes.

Updater/updater/assets/name.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import platform
2+
3+
4+
def get_goos_goarch():
5+
machine = platform.machine().lower()
6+
if machine in ("x86_64", "amd64"):
7+
goarch = "amd64"
8+
elif machine in ("aarch64", "arm64"):
9+
goarch = "arm64"
10+
elif machine in ("i386", "i686", "x86"):
11+
goarch = "386"
12+
elif machine.startswith("arm"):
13+
goarch = "arm"
14+
else:
15+
goarch = machine
16+
17+
return platform.system().lower(), goarch
18+
19+
def get_package_name_from_current_machine():
20+
goos, goarch = get_goos_goarch()
21+
22+
ext = ".zip" if goos == "windows" else ".tar.gz"
23+
return f"QuickNote_{goos}_{goarch}{ext}"

0 commit comments

Comments
 (0)