MCPcopy Create free account
hub / github.com/DonnieDice/protondrive-linux / patch_drive_app

Function patch_drive_app

scripts/patch_drive_linux_drawer.py:105–125  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

103 )
104
105 drive_window.write_text(content, encoding="utf-8")
106 print(f" ✓ Applied Linux drawer entry to {drive_window.relative_to(WEBCLIENTS_DIR)}")
107
108
109def patch_drive_app() -> None:
110 if not DRIVE_APP.exists():
111 fail("Unable to find Drive App.tsx in current WebClients layout")
112
113 app_content = DRIVE_APP.read_text(encoding="utf-8")
114 if "Proton Drive Linux owns native sync/settings controls in this rail." not in app_content:
115 app_content = app_content.replace(
116 "import { DRAWER_VISIBILITY } from '@proton/shared/lib/interfaces';\n", "", 1
117 )
118 app_content = replace_once(
119 app_content,
120 " showDrawerSidebar: userSettings.HideSidePanel === DRAWER_VISIBILITY.SHOW,\n",
121 " // Proton Drive Linux owns native sync/settings controls in this rail.\n"
122 " // Keep it visible by default so the Linux controls, Contacts,\n"
123 " // Calendar, and Referral entries are reachable in packaged\n"
124 " // desktop builds. The chevron can still collapse it.\n"
125 " showDrawerSidebar: true,\n",
126 "Drive drawer default visibility",
127 )
128 DRIVE_APP.write_text(app_content, encoding="utf-8")

Callers 1

mainFunction · 0.85

Calls 2

failFunction · 0.70
replace_onceFunction · 0.70

Tested by

no test coverage detected