Add launch_command to epic shortcuts

This commit is contained in:
Philip
2021-12-27 07:50:02 +01:00
parent acc7436ede
commit 1287a2ff84
+11 -5
View File
@@ -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());