项目文件夹

文件
wehub-resource-sync 2c632336aa
CI / Viewer CI (push) Successful in 13m37s
CI / Core CI (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:32:38 +08:00

20 行
506 B
Python

from __future__ import annotations
import os
import subprocess
import sys
from pathlib import Path
def open_in_file_manager(target: Path) -> None:
if sys.platform == "darwin":
subprocess.Popen(["open", str(target)])
return
if sys.platform.startswith("win"):
os.startfile(str(target))
return
if sys.platform.startswith("linux"):
subprocess.Popen(["xdg-open", str(target)])
return
raise RuntimeError(f"Unsupported platform: {sys.platform}")