Skip to content
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

String settings hooks #82

Merged
merged 16 commits into from
Apr 17, 2023
Merged

String settings hooks #82

merged 16 commits into from
Apr 17, 2023

Conversation

thesuzerain
Copy link
Contributor

@thesuzerain thesuzerain commented Apr 13, 2023

  • Wrapper Commands, pre and post (profile + global) - and add functionality
  • restructured process system to allow for ^^^
  • Theme (global only)
  • Splitting env arguments
  • JRE validator hook
  • profile_create function fix on frontend

Fixes MOD-380 + other miscellaneous things

Comment on lines 238 to 255
let post_exit_hooks =
&profile.hooks.as_ref().unwrap_or(&settings.hooks).post_exit;

let post_exit_hooks: Vec<Command> = post_exit_hooks
.iter()
.filter_map(|hook| {
let mut cmd = hook.split(' ');
if let Some(command) = cmd.next() {
let mut command = Command::new(command);
command
.args(&cmd.map(|s| s.to_string()).collect::<Vec<String>>())
.current_dir(path);
Some(command)
} else {
None
}
})
.collect();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

weren't we only doing one command for the post exit hooks?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah- it is only one command .but in this part its stored as a vec because previously it went from an iter to a vec (and you can iter over an Option so it worked mostly in place without changing this aspect)

I agree this is misleading though- so fixed.

theseus/src/state/children.rs Outdated Show resolved Hide resolved
@@ -74,6 +76,14 @@ impl Settings {
}
}

/// Theseus theme
#[derive(Debug, Clone, Copy, Serialize, Deserialize)]
pub enum Theme {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would use a rename all snake case here

Copy link
Contributor

@ZachBaird ZachBaird left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good for my part. The env args will be usable and the theme will be a setting. It just looks like Jai has a question around the hooks.

@Geometrically Geometrically merged commit 9f40640 into master Apr 17, 2023
@Geometrically Geometrically deleted the string-settings-hooks branch April 17, 2023 19:44
Geometrically added a commit that referenced this pull request Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants