diff --git a/latest.json b/latest.json new file mode 100644 index 0000000..a21cede --- /dev/null +++ b/latest.json @@ -0,0 +1,23 @@ +{ + "version": "0.3.0", + "notes": "Updater Works version", + "pub_date": "2022-11-25T00:50:57Z", + "platforms": { + "darwin-x86_64": { + "signature": "", + "url": "https://victorguyard-git-dev-flipfloop.vercel.app/public/releases/macos/Test.app.tar.gz" + }, + "darwin-aarch64": { + "signature": "", + "url": "https://github.com/FlipFloop/GaTechCourseChecker/releases/download/v0.3.0-beta/Georgia.Tech.Course.Checker.app.tar.gz" + }, + "linux-x86_64": { + "signature": "", + "url": "https://github.com/lemarier/tauri-test/releases/download/v1.0.0/app.AppImage.tar.gz" + }, + "windows-x86_64": { + "signature": "", + "url": "https://github.com/lemarier/tauri-test/releases/download/v1.0.0/app.x64.msi.zip" + } + } +} diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 93a3b3a..0f83bb4 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -16,7 +16,7 @@ tauri-build = { version = "1.1", features = [] } [dependencies] serde_json = "1.0" serde = { version = "1.0", features = ["derive"] } -tauri = { version = "1.1", features = ["api-all"] } +tauri = { version = "1.1", features = ["api-all", "updater"] } reqwest = {version = "0.11", features = ["blocking"] } scraper = "0.13.0" diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index bf1979f..f52aac7 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -16,7 +16,7 @@ struct Course { } #[tauri::command] -fn get_courses(courses: String) -> Vec> { +fn get_courses(courses: String) -> Vec> { println!("Courses searched: {}", courses); let mut free_courses: Vec> = vec![vec![], vec![]]; @@ -157,8 +157,21 @@ fn check_course_exists(course_id: String) -> bool { return true; } +use tauri::Manager; fn main() { + // tauri::window::emit("tauri://update".to_string(), None); + // tauri::listen("tauri://update-available".to_string(), move |msg| { + // println!("New version available: {:?}", msg); + // }); tauri::Builder::default() + .setup(|app| { + #[cfg(debug_assertions)] // only include this code on debug builds + { + let window = app.get_window("main").unwrap(); + window.open_devtools(); + } + Ok(()) + }) .invoke_handler(tauri::generate_handler![get_courses, check_course_exists]) .run(tauri::generate_context!()) .expect("error while running tauri application"); diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 2d80bd6..f51599b 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -7,8 +7,8 @@ "withGlobalTauri": false }, "package": { - "productName": "gatech-course-checker", - "version": "0.1.0" + "productName": "Georgia Tech Course Checker", + "version": "0.3.0" }, "tauri": { "allowlist": { @@ -51,15 +51,20 @@ "csp": null }, "updater": { - "active": false + "active": true, + "endpoints": [ + "https://raw.githubusercontent.com/FlipFloop/GaTechCourseChecker/updater/latest.json" + ], + "dialog": true, + "pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDQ0RjhDRDg4QTRCOURFRTEKUldUaDNybWtpTTM0UkhYcHptMzFsTU5CS2FWZmRrcmM5aVRGMWo1MzhkRG9JZWV3SzFEWXZJTkMK" }, "windows": [ { "fullscreen": false, - "height": 600, + "height": 700, "resizable": true, - "title": "gatech-course-checker", - "width": 800 + "title": "Georgia Tech Course Checker", + "width": 900 } ] } diff --git a/src/App.tsx b/src/App.tsx index 3a1bac0..9b9840c 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -14,6 +14,8 @@ import { import Results from "./components/Results"; import CourseEntry from "./components/CourseEntry"; +// "https://victorguyard-git-dev-flipfloop.vercel.app/releases/macos/0.3.0.json" + const App = () => { const [courseData, setCourseData] = createSignal([]); const [newCourse, setNewCourse] = createSignal(0);