Skip to content

Commit

Permalink
archive phase
Browse files Browse the repository at this point in the history
  • Loading branch information
BrettMayson committed Feb 27, 2025
1 parent e569bde commit 8d9ac3b
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions bin/src/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ impl Executor {
"pre_build" => module.pre_build(&self.ctx)?,
"post_build" => module.post_build(&self.ctx)?,
"pre_release" => module.pre_release(&self.ctx)?,
"archive" => module.archive(&self.ctx)?,
"post_release" => module.post_release(&self.ctx)?,
_ => unreachable!(),
});
Expand Down
4 changes: 4 additions & 0 deletions bin/src/modules/hook/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,10 @@ impl Module for Hooks {
self.run_folder(ctx, "pre_release", true)
}

fn archive(&self, ctx: &Context) -> Result<Report, Error> {
self.run_folder(ctx, "archive", false)
}

fn post_release(&self, ctx: &Context) -> Result<Report, Error> {
self.run_folder(ctx, "post_release", false)
}
Expand Down
7 changes: 7 additions & 0 deletions bin/src/modules/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ pub trait Module {
fn pre_release(&self, _ctx: &Context) -> Result<Report, Error> {
Ok(Report::new())
}
/// Executes the module's `archive` phase
///
/// # Errors
/// Any error that the module encounters
fn archive(&self, _ctx: &Context) -> Result<Report, Error> {
Ok(Report::new())
}
/// Executes the module's `post_release` phase
///
/// # Errors
Expand Down
5 changes: 5 additions & 0 deletions book/rhai/hooks/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ There are 4 phases of the build process that can be hooked into:
| `pre_build` | [Virtual](library/filesystem.md#hemtt_vfs---virtual-file-system) |
| `post_build` | [Virtual](library/filesystem.md#hemtt_vfs---virtual-file-system) |
| `pre_release` | [Real](library/filesystem.md#hemtt_rfs---real-file-system) |
| `archive` | [Real](library/filesystem.md#hemtt_rfs---real-file-system) |
| `post_release` | [Real](library/filesystem.md#hemtt_rfs---real-file-system) |

### `pre_build`
Expand All @@ -42,6 +43,10 @@ The `post_build` hook is run after all preprocessing, binarization, and packing

The `pre_release` hook is run before any release tasks. It is only run during the [hemtt release](../../commands/release.md) command.

### `archive`

The `archive` hook is run after HEMTT is done modifying the PBOs or other files, but before they are archived. If you need to rename or move files, this is the place to do it.

### `post_release`

The `post_release` hook is run after all release tasks, and archives have been created. It is only run during the [hemtt release](../../commands/release.md) command.

0 comments on commit 8d9ac3b

Please sign in to comment.