INNER CODE UNIT · Python
check_asar_existence
ArcSurge/Termius-Pro-zh_CN · lang.py:272
def check_asar_existence(path):
"""检查指定路径下是否存在 app.asar 文件"""
return os.path.exists(os.path.join(path, "app.asar"))
def select_directory(title):
"""弹出文件夹选择对话框"""
try:
root = tk.Tk()
root.withdraw()
selected_path = filedialog.askdirectory(title=title)
root.destroy()
return selected_path if is_valid_path(selected_path) else None
except Exception as e:
logging.error(f"Failed to select directory: {e}")
sys.exit(1)