Browse Source

docs: update command docs

remotes/origin/feat/support-install-latest
Fred 3 years ago
parent
commit
b384755fde
  1. 2
      .ci/prepare-version.js
  2. 4
      .ci/print-command-docs.js
  3. 4
      .github/workflows/rust.yml
  4. 32
      docs/commands.md

2
.ci/prepare-version.js

@ -17,7 +17,7 @@ const command = cmd.command({
async handler({}) { async handler({}) {
updateCargoToml(await getPackageVersion()) updateCargoToml(await getPackageVersion())
exec("cargo build --release") exec("cargo build --release")
exec("yarn generate-command-docs --binary-path=./target/release/fnm") exec("pnpm generate-command-docs --binary-path=./target/release/fnm")
exec("./.ci/record_screen.sh") exec("./.ci/record_screen.sh")
}, },
}) })

4
.ci/print-command-docs.js

@ -42,7 +42,7 @@ const command = cmd.command({
if (gitStatus.state === "dirty") { if (gitStatus.state === "dirty") {
process.exitCode = 1 process.exitCode = 1
console.error( console.error(
"The file has changed. Please re-run `yarn generate-command-docs`." "The file has changed. Please re-run `pnpm generate-command-docs`."
) )
console.error(`hint: The following diff was found:`) console.error(`hint: The following diff was found:`)
console.error() console.error()
@ -76,7 +76,7 @@ async function main(targetFile, fnmPath) {
stream.close() stream.close()
await execa(`yarn`, ["prettier", "--write", targetFile]) await execa(`pnpm`, ["prettier", "--write", targetFile])
} }
/** /**

4
.github/workflows/rust.yml

@ -339,7 +339,7 @@ jobs:
run: fnm --version run: fnm --version
- run: fnm install - run: fnm install
- name: Install Node deps - name: Install Node deps
run: fnm exec -- yarn run: fnm exec -- pnpm
- name: Generate command markdown - name: Generate command markdown
run: | run: |
fnm exec -- yarn generate-command-docs --check --binary-path=$(which fnm) fnm exec -- pnpm generate-command-docs --check --binary-path=$(which fnm)

32
docs/commands.md

@ -1,6 +1,7 @@
# `fnm` # `fnm`
``` ```
fnm 1.31.1 fnm 1.32.0
A fast and simple Node.js manager A fast and simple Node.js manager
USAGE: USAGE:
@ -77,7 +78,9 @@ SUBCOMMANDS:
use use
Change Node.js version Change Node.js version
``` ```
# `fnm alias` # `fnm alias`
``` ```
fnm-alias fnm-alias
Alias a version to a common name Alias a version to a common name
@ -132,7 +135,9 @@ OPTIONS:
[default: local] [default: local]
[possible values: local, recursive] [possible values: local, recursive]
``` ```
# `fnm completions` # `fnm completions`
``` ```
fnm-completions fnm-completions
Print shell completions to stdout Print shell completions to stdout
@ -183,7 +188,9 @@ OPTIONS:
[default: local] [default: local]
[possible values: local, recursive] [possible values: local, recursive]
``` ```
# `fnm current` # `fnm current`
``` ```
fnm-current fnm-current
Print the current Node.js version Print the current Node.js version
@ -231,7 +238,9 @@ OPTIONS:
[default: local] [default: local]
[possible values: local, recursive] [possible values: local, recursive]
``` ```
# `fnm default` # `fnm default`
``` ```
fnm-default fnm-default
Set a version as the default version Set a version as the default version
@ -285,7 +294,9 @@ OPTIONS:
[default: local] [default: local]
[possible values: local, recursive] [possible values: local, recursive]
``` ```
# `fnm env` # `fnm env`
``` ```
fnm-env fnm-env
Print and set up required environment variables for fnm Print and set up required environment variables for fnm
@ -314,6 +325,9 @@ OPTIONS:
-h, --help -h, --help
Print help information Print help information
--json
Print JSON instead of shell commands
--log-level <LOG_LEVEL> --log-level <LOG_LEVEL>
The log level of fnm commands The log level of fnm commands
@ -348,7 +362,9 @@ OPTIONS:
[default: local] [default: local]
[possible values: local, recursive] [possible values: local, recursive]
``` ```
# `fnm exec` # `fnm exec`
``` ```
fnm-exec fnm-exec
Run a command within fnm context Run a command within fnm context
@ -408,11 +424,15 @@ OPTIONS:
[default: local] [default: local]
[possible values: local, recursive] [possible values: local, recursive]
``` ```
# `fnm help` # `fnm help`
``` ```
``` ```
# `fnm install` # `fnm install`
``` ```
fnm-install fnm-install
Install a new Node.js version Install a new Node.js version
@ -470,7 +490,9 @@ OPTIONS:
[default: local] [default: local]
[possible values: local, recursive] [possible values: local, recursive]
``` ```
# `fnm list` # `fnm list`
``` ```
fnm-list fnm-list
List all locally installed Node.js versions List all locally installed Node.js versions
@ -518,7 +540,9 @@ OPTIONS:
[default: local] [default: local]
[possible values: local, recursive] [possible values: local, recursive]
``` ```
# `fnm list-remote` # `fnm list-remote`
``` ```
fnm-list-remote fnm-list-remote
List all remote Node.js versions List all remote Node.js versions
@ -566,7 +590,9 @@ OPTIONS:
[default: local] [default: local]
[possible values: local, recursive] [possible values: local, recursive]
``` ```
# `fnm unalias` # `fnm unalias`
``` ```
fnm-unalias fnm-unalias
Remove an alias definition Remove an alias definition
@ -618,7 +644,9 @@ OPTIONS:
[default: local] [default: local]
[possible values: local, recursive] [possible values: local, recursive]
``` ```
# `fnm uninstall` # `fnm uninstall`
``` ```
fnm-uninstall fnm-uninstall
Uninstall a Node.js version Uninstall a Node.js version
@ -673,7 +701,9 @@ OPTIONS:
[default: local] [default: local]
[possible values: local, recursive] [possible values: local, recursive]
``` ```
# `fnm use` # `fnm use`
``` ```
fnm-use fnm-use
Change Node.js version Change Node.js version

Loading…
Cancel
Save