mirror of
https://github.com/starship/starship.git
synced 2025-03-12 14:08:36 +01:00
feat(nodejs): disable if bun project files detected (#6346)
This commit is contained in:
parent
2357c955ed
commit
00ce7057ef
10
.github/config-schema.json
vendored
10
.github/config-schema.json
vendored
@ -1148,7 +1148,10 @@
|
|||||||
"detect_files": [
|
"detect_files": [
|
||||||
"package.json",
|
"package.json",
|
||||||
".node-version",
|
".node-version",
|
||||||
".nvmrc"
|
".nvmrc",
|
||||||
|
"!bunfig.toml",
|
||||||
|
"!bun.lock",
|
||||||
|
"!bun.lockb"
|
||||||
],
|
],
|
||||||
"detect_folders": [
|
"detect_folders": [
|
||||||
"node_modules"
|
"node_modules"
|
||||||
@ -4779,7 +4782,10 @@
|
|||||||
"default": [
|
"default": [
|
||||||
"package.json",
|
"package.json",
|
||||||
".node-version",
|
".node-version",
|
||||||
".nvmrc"
|
".nvmrc",
|
||||||
|
"!bunfig.toml",
|
||||||
|
"!bun.lock",
|
||||||
|
"!bun.lockb"
|
||||||
],
|
],
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
|
@ -646,7 +646,7 @@ By default the module will be shown if any of the following conditions are met:
|
|||||||
|
|
||||||
*: This variable can only be used as a part of a style string
|
*: This variable can only be used as a part of a style string
|
||||||
|
|
||||||
### Examples
|
### Example
|
||||||
|
|
||||||
#### Customize the format
|
#### Customize the format
|
||||||
|
|
||||||
@ -657,15 +657,6 @@ By default the module will be shown if any of the following conditions are met:
|
|||||||
format = 'via [🍔 $version](bold green) '
|
format = 'via [🍔 $version](bold green) '
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Replace Node.js
|
|
||||||
|
|
||||||
You can override the `detect_files` property of [the nodejs module](#nodejs) in your config so as to only show the bun runtime:
|
|
||||||
|
|
||||||
```toml
|
|
||||||
[nodejs]
|
|
||||||
detect_files = ['package.json', '.node-version', '!bunfig.toml', '!bun.lockb']
|
|
||||||
```
|
|
||||||
|
|
||||||
## C
|
## C
|
||||||
|
|
||||||
The `c` module shows some information about your C compiler. By default
|
The `c` module shows some information about your C compiler. By default
|
||||||
@ -3141,6 +3132,8 @@ By default the module will be shown if any of the following conditions are met:
|
|||||||
- The current directory contains a file with the `.js`, `.mjs` or `.cjs` extension
|
- The current directory contains a file with the `.js`, `.mjs` or `.cjs` extension
|
||||||
- The current directory contains a file with the `.ts`, `.mts` or `.cts` extension
|
- The current directory contains a file with the `.ts`, `.mts` or `.cts` extension
|
||||||
|
|
||||||
|
Additionally, the module will be hidden by default if the directory contains a `bunfig.toml`, `bun.lock`, or `bun.lockb` file, overriding the above conditions.
|
||||||
|
|
||||||
### Options
|
### Options
|
||||||
|
|
||||||
| Option | Default | Description |
|
| Option | Default | Description |
|
||||||
|
@ -29,7 +29,14 @@ impl Default for NodejsConfig<'_> {
|
|||||||
disabled: false,
|
disabled: false,
|
||||||
not_capable_style: "bold red",
|
not_capable_style: "bold red",
|
||||||
detect_extensions: vec!["js", "mjs", "cjs", "ts", "mts", "cts"],
|
detect_extensions: vec!["js", "mjs", "cjs", "ts", "mts", "cts"],
|
||||||
detect_files: vec!["package.json", ".node-version", ".nvmrc"],
|
detect_files: vec![
|
||||||
|
"package.json",
|
||||||
|
".node-version",
|
||||||
|
".nvmrc",
|
||||||
|
"!bunfig.toml",
|
||||||
|
"!bun.lock",
|
||||||
|
"!bun.lockb",
|
||||||
|
],
|
||||||
detect_folders: vec!["node_modules"],
|
detect_folders: vec!["node_modules"],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user