Skip to content

Commit

Permalink
config: fix toml move-to-workspace action
Browse files Browse the repository at this point in the history
  • Loading branch information
mahkoh committed Mar 17, 2024
1 parent c921e24 commit 2a517f4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions toml-config/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ pub enum Action {
ConfigureInput { input: Input },
ConfigureOutput { out: Output },
Exec { exec: Exec },
MoveToWorkspace { name: String },
Multi { actions: Vec<Action> },
SetEnv { env: Vec<(String, String)> },
SetGfxApi { api: GfxApi },
Expand Down
2 changes: 1 addition & 1 deletion toml-config/src/config/parsers/action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ impl ActionParser<'_> {

fn parse_move_to_workspace(&mut self, ext: &mut Extractor<'_>) -> ParseResult<Self> {
let name = ext.extract(str("name"))?.value.to_string();
Ok(Action::ShowWorkspace { name })
Ok(Action::MoveToWorkspace { name })
}

fn parse_configure_connector(&mut self, ext: &mut Extractor<'_>) -> ParseResult<Self> {
Expand Down
4 changes: 4 additions & 0 deletions toml-config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ impl Action {
let workspace = get_workspace(&name);
Box::new(move || s.show_workspace(workspace))
}
Action::MoveToWorkspace { name } => {
let workspace = get_workspace(&name);
Box::new(move || s.set_workspace(workspace))
}
Action::ConfigureConnector { con } => Box::new(move || {
for c in connectors() {
if con.match_.matches(c) {
Expand Down

0 comments on commit 2a517f4

Please sign in to comment.