Skip to content

Commit

Permalink
feat: update npm plugin error types and add plugin startup spinner phase
Browse files Browse the repository at this point in the history
Signed-off-by: jlanson <[email protected]>
  • Loading branch information
j-lanson committed Feb 20, 2025
1 parent 8b3d8e0 commit ab8cd5c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
6 changes: 6 additions & 0 deletions hipcheck/src/session/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,13 @@ fn setup_base_session(

let executor = ExecConfig::get_plugin_executor(&exec_config)?;

// Start plugins and display as such to users
let phase = SpinnerPhase::start("starting plugins");
phase.inc();
phase.enable_steady_tick(Duration::from_millis(100));
let core = start_plugins(&policy, &plugin_cache, executor)?;
phase.finish_successful();

session_builder.set_core(core);

Ok(session_builder)
Expand Down
7 changes: 6 additions & 1 deletion plugins/npm/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,12 @@ impl Plugin for DependenciesPlugin {
const NAME: &'static str = "npm";

fn set_config(&self, _config: Value) -> std::result::Result<(), ConfigError> {
Ok(())
match get_npm_version() {
Err(_) => Err(ConfigError::MissingProgram {
program_name: "npm".to_owned(),
}),
Ok(_) => Ok(()),
}
}

fn default_policy_expr(&self) -> hipcheck_sdk::prelude::Result<String> {
Expand Down

0 comments on commit ab8cd5c

Please sign in to comment.