Fix CI maybe

This commit is contained in:
Ben C 2024-10-06 12:20:40 -04:00
parent 04a26584d5
commit 6452789b8b
No known key found for this signature in database
7 changed files with 35 additions and 18 deletions

View File

@ -53,8 +53,16 @@ jobs:
- name: Install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev librsvg2-dev
sudo apt update
sudo apt install libwebkit2gtk-4.1-dev \
build-essential \
curl \
wget \
file \
libxdo-dev \
libssl-dev \
libayatana-appindicator3-dev \
librsvg2-dev
- name: Setup Rust Toolchain
uses: dtolnay/rust-toolchain@stable

View File

@ -72,7 +72,7 @@ rustPlatform.buildRustPackage rec {
inherit version;
pname = "owmods_gui-ui";
npmDepsHash = "sha256-ZD1qVbA1Aj9BAj75A2nj/kiN2O0Ulxr9KnQTRJFvyOM=";
npmDepsHash = "sha256-ePluInAXh9mUAkyNCE7jWU4Dh90xdHcVf0TInjyaF2U=";
src = ../owmods_gui/frontend;
packageJSON = ../owmods_gui/frontend/package.json;

View File

@ -345,7 +345,10 @@ pub async fn install_mod(
current_mod.manifest.name
))
.kind(MessageDialogKind::Info)
.buttons(MessageDialogButtons::OkCancelCustom("Yes".to_string(), "No".to_string()))
.buttons(MessageDialogButtons::OkCancelCustom(
"Yes".to_string(),
"No".to_string(),
))
.title("Reinstall?")
.blocking_show();
}
@ -913,7 +916,10 @@ pub async fn db_has_issues(state: tauri::State<'_, State>, window: tauri::Window
owml.manifest.version
))
.kind(MessageDialogKind::Info)
.buttons(MessageDialogButtons::OkCancelCustom("Yes".to_string(), "No".to_string()))
.buttons(MessageDialogButtons::OkCancelCustom(
"Yes".to_string(),
"No".to_string(),
))
.title("Update OWML?")
.blocking_show();
if answer {

View File

@ -94,8 +94,6 @@ pub struct State {
mods_in_progress: StatePart<Vec<String>>,
}
fn main() -> Result<(), Box<dyn Error>> {
let config = Config::get(None).unwrap_or(Config::default(None)?);
let gui_config = GuiConfig::get().unwrap_or_default();
@ -117,7 +115,7 @@ fn main() -> Result<(), Box<dyn Error>> {
})
.plugin(tauri_plugin_single_instance::init(|_app, _argv, _cwd| {
println!("New app instance opened, invoked URI handler.");
}))
}))
.plugin(tauri_plugin_deep_link::init())
.setup(move |app| {
// Logger Setup
@ -139,6 +137,9 @@ fn main() -> Result<(), Box<dyn Error>> {
#[cfg(any(target_os = "linux", all(debug_assertions, windows)))]
let res = app.deep_link().register_all();
#[cfg(not(any(target_os = "linux", all(debug_assertions, windows))))]
let res = Result::<(), anyhow::Error>::Ok(());
if let Err(why) = res {
warn!("Failed to setup URI handler: {:?}", why);
} else {

View File

@ -11,7 +11,11 @@ pub const PROTOCOL_LISTENER_AMOUNT: usize = 2;
pub fn prep_protocol(handle: tauri::AppHandle) {
let handle_inner = handle.clone();
handle.deep_link().on_open_url(move |request| {
let request = request.urls().first().map(|u| u.to_string()).unwrap_or_default();
let request = request
.urls()
.first()
.map(|u| u.to_string())
.unwrap_or_default();
let protocol_payload = ProtocolPayload::parse(&request);
match protocol_payload.verb {
ProtocolVerb::Unknown => {

View File

@ -16,12 +16,12 @@ export default defineConfig({
strictPort: true,
host: host || false,
hmr: host
? {
protocol: "ws",
host,
port: 1421,
}
: undefined,
? {
protocol: "ws",
host,
port: 1421
}
: undefined,
watch: {
ignored: ["owmods_gui/backend/target/**"]
}

View File

@ -16,9 +16,7 @@ pub fn disable_updater() -> Result<()> {
// Cargo.toml
let cargo_toml = std::fs::read_to_string(GUI_CARGO_TOML_PATH)?;
let mut cargo_toml = cargo_toml.parse::<DocumentMut>()?;
let features = cargo_toml["dependencies"]
.as_table_mut()
.unwrap();
let features = cargo_toml["dependencies"].as_table_mut().unwrap();
features.remove("tauri-plugin-updater");
// Write to files
std::fs::write(