Skip to content

Commit 5808b6f

Browse files
Merge pull request #894 from haochuan/activity-kind
Add detailed activity kind to event for node/yarn/npm/npx
2 parents cb9c250 + 79cc4a7 commit 5808b6f

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

crates/volta-core/src/run/node.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ use super::executor::{Executor, ToolCommand, ToolKind};
55
use super::{debug_active_image, debug_no_platform, RECURSION_ENV_VAR};
66
use crate::error::{ErrorKind, Fallible};
77
use crate::platform::{Platform, System};
8-
use crate::session::Session;
8+
use crate::session::{ActivityKind, Session};
99

1010
/// Build a `ToolCommand` for Node
1111
pub(super) fn command(args: &[OsString], session: &mut Session) -> Fallible<Executor> {
12+
session.add_event_start(ActivityKind::Node);
1213
// Don't re-evaluate the platform if this is a recursive call
1314
let platform = match env::var_os(RECURSION_ENV_VAR) {
1415
Some(_) => None,

crates/volta-core/src/run/npm.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use super::parser::CommandArg;
66
use super::{debug_active_image, debug_no_platform, RECURSION_ENV_VAR};
77
use crate::error::{ErrorKind, Fallible};
88
use crate::platform::{Platform, System};
9-
use crate::session::Session;
9+
use crate::session::{ActivityKind, Session};
1010

1111
/// Build an `Executor` for npm
1212
///
@@ -17,6 +17,7 @@ use crate::session::Session;
1717
/// If the command is _not_ a global install / uninstall or we don't have a default platform, then
1818
/// we will allow npm to execute the command as usual.
1919
pub(super) fn command(args: &[OsString], session: &mut Session) -> Fallible<Executor> {
20+
session.add_event_start(ActivityKind::Npm);
2021
// Don't re-evaluate the context or global install interception if this is a recursive call
2122
let platform = match env::var_os(RECURSION_ENV_VAR) {
2223
Some(_) => None,

crates/volta-core/src/run/npx.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use super::executor::{Executor, ToolCommand, ToolKind};
55
use super::{debug_active_image, debug_no_platform, RECURSION_ENV_VAR};
66
use crate::error::{ErrorKind, Fallible};
77
use crate::platform::{Platform, System};
8-
use crate::session::Session;
8+
use crate::session::{ActivityKind, Session};
99
use lazy_static::lazy_static;
1010
use semver::Version;
1111

@@ -16,6 +16,7 @@ lazy_static! {
1616

1717
/// Build a `ToolCommand` for npx
1818
pub(super) fn command(args: &[OsString], session: &mut Session) -> Fallible<Executor> {
19+
session.add_event_start(ActivityKind::Npx);
1920
// Don't re-evaluate the context if this is a recursive call
2021
let platform = match env::var_os(RECURSION_ENV_VAR) {
2122
Some(_) => None,

crates/volta-core/src/run/yarn.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use super::parser::CommandArg;
66
use super::{debug_active_image, debug_no_platform, RECURSION_ENV_VAR};
77
use crate::error::{ErrorKind, Fallible};
88
use crate::platform::{Platform, Source, System};
9-
use crate::session::Session;
9+
use crate::session::{ActivityKind, Session};
1010

1111
/// Build an `Executor` for Yarn
1212
///
@@ -17,6 +17,7 @@ use crate::session::Session;
1717
/// If the command is _not_ a global add / remove or we don't have a default platform, then
1818
/// we will allow Yarn to execute the command as usual.
1919
pub(super) fn command(args: &[OsString], session: &mut Session) -> Fallible<Executor> {
20+
session.add_event_start(ActivityKind::Yarn);
2021
// Don't re-evaluate the context or global install interception if this is a recursive call
2122
let platform = match env::var_os(RECURSION_ENV_VAR) {
2223
Some(_) => None,

0 commit comments

Comments
 (0)