Skip to content

Commit 4f9767e

Browse files
remove version label
1 parent b529043 commit 4f9767e

3 files changed

Lines changed: 35 additions & 3 deletions

File tree

  • crates/vite_global_cli/src/commands
  • packages/cli/snap-tests-global

crates/vite_global_cli/src/commands/version.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,10 @@ pub async fn execute(cwd: AbsolutePathBuf) -> Result<ExitStatus, Error> {
198198

199199
let node_info = get_node_version_info(&cwd)
200200
.await
201-
.map(|(v, s)| format!("v{v} ({s})"))
201+
.map(|(v, s)| match s.as_str() {
202+
"lts" | "default" | "system" => format!("v{v}"),
203+
_ => format!("v{v} ({s})"),
204+
})
202205
.unwrap_or(NOT_FOUND.to_string());
203206

204207
let env_rows = [("Package manager", package_manager_info), ("Node.js", node_info)];

packages/cli/snap-tests-global/cli-helper-message/snap.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Tools:
7171

7272
Environment:
7373
Package manager Not found
74-
Node.js v<semver> (default)
74+
Node.js v<semver>
7575

7676
> vp install -h # show install help message
7777
VITE+ - The Unified Toolchain for the Web
@@ -440,4 +440,3 @@ Options:
440440
-h, --help Print help
441441

442442
Documentation: https://viteplus.dev/guide/upgrade
443-

packages/cli/snap-tests-global/command-staged-with-config/snap.txt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,33 @@
2323
> printf 'eval("code");\n' > src/fail.js && git add src/fail.js
2424
[1]> vp staged # should fail when staged .js file has lint errors
2525
[STARTED] Backing up original state...
26+
[COMPLETED] Backed up original state in git stash (<hash>)
27+
[STARTED] Running tasks for staged files...
28+
[STARTED] Config object — 1 file
29+
[STARTED] *.ts — 0 files
30+
[STARTED] *.js — 1 file
31+
[SKIPPED] *.ts — no files
32+
[STARTED] vp lint
33+
[FAILED] vp lint [FAILED]
34+
[FAILED] vp lint [FAILED]
35+
[COMPLETED] Running tasks for staged files...
36+
[STARTED] Applying modifications from tasks...
37+
[SKIPPED] Skipped because of errors from tasks.
38+
[STARTED] Reverting to original state because of errors...
39+
[COMPLETED] Reverting to original state because of errors...
40+
[STARTED] Cleaning up temporary files...
41+
[COMPLETED] Cleaning up temporary files...
42+
43+
✖ vp lint:
44+
VITE+ - The Unified Toolchain for the Web
45+
46+
47+
× eslint(no-eval): eval can be harmful.
48+
╭─[src/fail.js:1:1]
49+
1 │ eval("code");
50+
· ────
51+
╰────
52+
help: Avoid eval(). For JSON parsing use JSON.parse(); for dynamic property access use bracket notation (obj[key]); for other cases refactor to avoid evaluating strings as code.
53+
54+
Found 0 warnings and 1 error.
55+
Finished in <variable>ms on 1 file with <variable> rules using <variable> threads.

0 commit comments

Comments
 (0)