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 serde::{Deserialize, Serialize};
|
||||||
use steam_shortcuts_util::{Shortcut, shortcut::ShortcutOwned};
|
use steam_shortcuts_util::{Shortcut, shortcut::ShortcutOwned};
|
||||||
|
|
||||||
@@ -17,14 +19,18 @@ pub(crate) struct ManifestItem {
|
|||||||
|
|
||||||
#[serde(alias = "AppName")]
|
#[serde(alias = "AppName")]
|
||||||
pub app_name: String,
|
pub app_name: String,
|
||||||
|
|
||||||
|
#[serde(alias = "LaunchCommand")]
|
||||||
|
pub launch_command: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
impl From<ManifestItem> for ShortcutOwned {
|
impl From<ManifestItem> for ShortcutOwned {
|
||||||
fn from(manifest: ManifestItem) -> Self {
|
fn from(manifest: ManifestItem) -> Self {
|
||||||
let exe = format!(
|
|
||||||
"\"{}\\{}\"",
|
let exe_path = Path::new(&manifest.install_location).join(manifest.launch_executable).to_string_lossy().to_string();
|
||||||
manifest.install_location, manifest.launch_executable
|
let exe = format!("\"{}\"",exe_path);
|
||||||
);
|
|
||||||
let mut start_dir = manifest.install_location.clone();
|
let mut start_dir = manifest.install_location.clone();
|
||||||
if !manifest.install_location.starts_with('"') {
|
if !manifest.install_location.starts_with('"') {
|
||||||
start_dir = format!("\"{}\"", manifest.install_location);
|
start_dir = format!("\"{}\"", manifest.install_location);
|
||||||
@@ -36,7 +42,7 @@ impl From<ManifestItem> for ShortcutOwned {
|
|||||||
start_dir.as_str(),
|
start_dir.as_str(),
|
||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
"",
|
manifest.launch_command.as_str(),
|
||||||
);
|
);
|
||||||
let mut owned_shortcut = shortcut.to_owned();
|
let mut owned_shortcut = shortcut.to_owned();
|
||||||
owned_shortcut.tags.push("EGS".to_owned());
|
owned_shortcut.tags.push("EGS".to_owned());
|
||||||
|
|||||||
Reference in New Issue
Block a user