added module options

This commit is contained in:
2026-03-07 09:15:30 -05:00
parent 7d9ecb8823
commit d7419bcf3b
4 changed files with 63 additions and 6 deletions

28
patch-lib.py Normal file
View File

@@ -0,0 +1,28 @@
import sys
target = '.run(tauri::generate_context!())'
replacement = '''.setup(|app| {
if let Ok(server_url) = std::env::var("PINEPODS_SERVER") {
if !server_url.is_empty() {
use tauri::Manager;
let window = app.get_webview_window("main").unwrap();
window.navigate(server_url.parse().unwrap()).unwrap();
}
}
Ok(())
})
.run(tauri::generate_context!())'''
with open(sys.argv[1], 'r') as f:
content = f.read()
if target not in content:
print(f"ERROR: Could not find target string in {sys.argv[1]}")
sys.exit(1)
content = content.replace(target, replacement)
with open(sys.argv[1], 'w') as f:
f.write(content)
print("Successfully patched lib.rs")