Skip to content

Commit b80be6c

Browse files
committed
fix(env): align vp list -g output format with vp env which
Show Package, Binaries, Node.js, and Installed fields in the same style as the which command output.
1 parent b009326 commit b80be6c

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ jobs:
249249

250250
- name: 'Setup npm'
251251
run: |
252-
vp install -g npm@latest
252+
npm install -g npm@latest
253253
254254
- name: Publish native addons
255255
run: |

crates/vite_global_cli/src/commands/env/packages.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
33
use std::process::ExitStatus;
44

5+
use chrono::Local;
6+
57
use super::package_metadata::PackageMetadata;
68
use crate::error::Error;
79

@@ -40,10 +42,14 @@ pub async fn execute(json: bool, pattern: Option<&str>) -> Result<ExitStatus, Er
4042
println!();
4143

4244
for pkg in &packages {
43-
println!(" {} v{} (Node {})", pkg.name, pkg.version, pkg.platform.node);
45+
let installed_local = pkg.installed_at.with_timezone(&Local);
46+
let installed_str = installed_local.format("%Y-%m-%d %H:%M:%S").to_string();
47+
println!(" Package: {}@{}", pkg.name, pkg.version);
4448
if !pkg.bins.is_empty() {
45-
println!(" Binaries: {}", pkg.bins.join(", "));
49+
println!(" Binaries: {}", pkg.bins.join(", "));
4650
}
51+
println!(" Node.js: {}", pkg.platform.node);
52+
println!(" Installed: {}", installed_str);
4753
println!();
4854
}
4955
}

0 commit comments

Comments
 (0)