-
Notifications
You must be signed in to change notification settings - Fork 337
Split wrapper string into separate command and arguments #3900
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 6 commits
9e9318a
c7b3c2f
c6841b8
a786267
1a43add
4e10adf
32a48f4
d0dcc4c
e4fc4d5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -103,17 +103,19 @@ impl ProfileInstallStage { | |
pub enum LauncherFeatureVersion { | ||
None, | ||
MigratedServerLastPlayTime, | ||
MigratedWrapperHook, | ||
} | ||
|
||
impl LauncherFeatureVersion { | ||
pub const MOST_RECENT: Self = Self::MigratedServerLastPlayTime; | ||
pub const MOST_RECENT: Self = Self::MigratedWrapperHook; | ||
|
||
pub fn as_str(&self) -> &'static str { | ||
match *self { | ||
Self::None => "none", | ||
Self::MigratedServerLastPlayTime => { | ||
"migrated_server_last_play_time" | ||
} | ||
Self::MigratedWrapperHook => "migrated_wrapper_hook", | ||
} | ||
} | ||
|
||
|
@@ -123,6 +125,7 @@ impl LauncherFeatureVersion { | |
"migrated_server_last_play_time" => { | ||
Self::MigratedServerLastPlayTime | ||
} | ||
"migrated_wrapper_hook" => Self::MigratedWrapperHook, | ||
_ => Self::None, | ||
} | ||
} | ||
|
@@ -782,6 +785,20 @@ impl Profile { | |
self.launcher_feature_version = | ||
LauncherFeatureVersion::MigratedServerLastPlayTime; | ||
} | ||
LauncherFeatureVersion::MigratedServerLastPlayTime => { | ||
if let Some(wrapper) = self.hooks.wrapper.as_ref() { | ||
self.hooks.wrapper = Some( | ||
shlex::Quoter::new() | ||
.allow_nul(true) | ||
.quote(wrapper) | ||
.unwrap() | ||
.to_string(), | ||
) | ||
} | ||
|
||
self.launcher_feature_version = | ||
LauncherFeatureVersion::MigratedWrapperHook; | ||
|
||
} | ||
LauncherFeatureVersion::MOST_RECENT => unreachable!( | ||
"LauncherFeatureVersion::MOST_RECENT was not updated" | ||
), | ||
|
Uh oh!
There was an error while loading. Please reload this page.