mirror of
https://github.com/djibux/BoilR.git
synced 2026-09-01 05:53:41 +02:00
Add launch_command to epic shortcuts
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
use std::path::Path;
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use steam_shortcuts_util::{Shortcut, shortcut::ShortcutOwned};
|
||||
|
||||
@@ -17,14 +19,18 @@ pub(crate) struct ManifestItem {
|
||||
|
||||
#[serde(alias = "AppName")]
|
||||
pub app_name: String,
|
||||
|
||||
#[serde(alias = "LaunchCommand")]
|
||||
pub launch_command: String,
|
||||
}
|
||||
|
||||
|
||||
|
||||
impl From<ManifestItem> for ShortcutOwned {
|
||||
fn from(manifest: ManifestItem) -> Self {
|
||||
let exe = format!(
|
||||
"\"{}\\{}\"",
|
||||
manifest.install_location, manifest.launch_executable
|
||||
);
|
||||
|
||||
let exe_path = Path::new(&manifest.install_location).join(manifest.launch_executable).to_string_lossy().to_string();
|
||||
let exe = format!("\"{}\"",exe_path);
|
||||
let mut start_dir = manifest.install_location.clone();
|
||||
if !manifest.install_location.starts_with('"') {
|
||||
start_dir = format!("\"{}\"", manifest.install_location);
|
||||
@@ -36,7 +42,7 @@ impl From<ManifestItem> for ShortcutOwned {
|
||||
start_dir.as_str(),
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
manifest.launch_command.as_str(),
|
||||
);
|
||||
let mut owned_shortcut = shortcut.to_owned();
|
||||
owned_shortcut.tags.push("EGS".to_owned());
|
||||
|
||||
Reference in New Issue
Block a user