Browse Source

Improvements to the README (#377)

remotes/origin/add-with-shims
Waldir Pimenta 4 years ago committed by GitHub
parent
commit
e7dc3c8799
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      .ci/install.sh
  2. 4
      .github/workflows/rust.yml
  3. 38
      README.md

2
.ci/install.sh

@ -56,7 +56,7 @@ set_filename() {
FILENAME="fnm-macos" FILENAME="fnm-macos"
USE_HOMEBREW="false" USE_HOMEBREW="false"
echo "Downloading the latest fnm binary from GitHub..." echo "Downloading the latest fnm binary from GitHub..."
echo " Pro tip: it's eaiser to use Homebrew for managing fnm in MacOS." echo " Pro tip: it's eaiser to use Homebrew for managing fnm in macOS."
echo " Remove the \`--force-no-brew\` so it will be easy to upgrade." echo " Remove the \`--force-no-brew\` so it will be easy to upgrade."
elif [ "$OS" == "Darwin" ]; then elif [ "$OS" == "Darwin" ]; then
USE_HOMEBREW="true" USE_HOMEBREW="true"

4
.github/workflows/rust.yml

@ -1,6 +1,6 @@
name: Rust name: Rust
on: on:
pull_request: pull_request:
push: push:
branches: branches:
@ -68,7 +68,7 @@ jobs:
build_macos_release: build_macos_release:
runs-on: macOS-latest runs-on: macOS-latest
name: "Release build for MacOS" name: "Release build for macOS"
steps: steps:
- uses: hecrj/setup-rust-action@v1 - uses: hecrj/setup-rust-action@v1
with: with:

38
README.md

@ -12,7 +12,7 @@
## Features ## Features
:earth_americas: Cross-platform support (Mac, Windows, Linux) :earth_americas: Cross-platform support (macOS, Windows, Linux)
:sparkles: Single file, easy installation, instant startup :sparkles: Single file, easy installation, instant startup
@ -22,17 +22,17 @@
## Installation ## Installation
### Using a script (MacOS/Linux) ### Using a script (macOS/Linux)
For `bash`, `zsh` and `fish` shells, there's an [automatic installation script](./.ci/install.sh): For `bash`, `zsh` and `fish` shells, there's an [automatic installation script](./.ci/install.sh):
```bash ```sh
curl -fsSL https://fnm.vercel.app/install | bash curl -fsSL https://fnm.vercel.app/install | bash
``` ```
#### Upgrade #### Upgrade
On OSX, it is a simple as `brew upgrade fnm`. On macOS, it is as simple as `brew upgrade fnm`.
On other operating systems, upgrading `fnm` is almost the same as installing it. To prevent duplication in your shell config file add `--skip-shell` to install command. On other operating systems, upgrading `fnm` is almost the same as installing it. To prevent duplication in your shell config file add `--skip-shell` to install command.
@ -48,19 +48,19 @@ Skip appending shell specific loader to shell config file, based on the current
`--force-install` `--force-install`
MacOS installations using the installation script are deprecated in favor of the Homebrew formula, but this forces the script to install using it anyway. macOS installations using the installation script are deprecated in favor of the Homebrew formula, but this forces the script to install using it anyway.
Example: Example:
```bash ```sh
curl -fsSL https://fnm.vercel.app/install | bash -s -- --install-dir "./.fnm" --skip-shell curl -fsSL https://fnm.vercel.app/install | bash -s -- --install-dir "./.fnm" --skip-shell
``` ```
### Manually ### Manually
#### Using Homebrew (OSX) #### Using Homebrew (macOS/Linux)
```bash ```sh
brew install fnm brew install fnm
``` ```
@ -68,21 +68,21 @@ Then, [set up your shell for fnm](#shell-setup)
#### Using Scoop (Windows) #### Using Scoop (Windows)
```bash ```sh
scoop install fnm scoop install fnm
``` ```
Then, [set up your shell for fnm](#shell-setup) Then, [set up your shell for fnm](#shell-setup)
#### Using Cargo (Linux/Mac/Windows) #### Using Cargo (Linux/macOS/Windows)
```bash ```sh
cargo install fnm cargo install fnm
``` ```
Then, [set up your shell for fnm](#shell-setup) Then, [set up your shell for fnm](#shell-setup)
#### Using a release binary (Linux/Mac/Windows) #### Using a release binary (Linux/macOS/Windows)
- Download the [latest release binary](https://github.com/Schniz/fnm/releases) for your system - Download the [latest release binary](https://github.com/Schniz/fnm/releases) for your system
- Make it available globally on `PATH` environment variable - Make it available globally on `PATH` environment variable
@ -92,7 +92,7 @@ Then, [set up your shell for fnm](#shell-setup)
fnm ships its completions with the binary: fnm ships its completions with the binary:
``` ```sh
fnm completions --shell <SHELL> fnm completions --shell <SHELL>
``` ```
@ -143,13 +143,13 @@ fnm env --use-on-cd | Out-String | Invoke-Expression
``` ```
- On Windows, the profile is located at `~\Documents\PowerShell\Microsoft.PowerShell_profile.ps1` - On Windows, the profile is located at `~\Documents\PowerShell\Microsoft.PowerShell_profile.ps1`
- For Mac/Linux, the profile is located at `~/.config/powershell/Microsoft.PowerShell_profile.ps1` - For macOS/Linux, the profile is located at `~/.config/powershell/Microsoft.PowerShell_profile.ps1`
#### Windows Command Prompt aka Batch aka WinCMD #### Windows Command Prompt aka Batch aka WinCMD
fnm is also supported but is not entirely covered. [You can set up a startup script](https://superuser.com/a/144348) and append the following line: fnm is also supported but is not entirely covered. [You can set up a startup script](https://superuser.com/a/144348) and append the following line:
``` ```batch
FOR /f "tokens=*" %i IN ('fnm env --use-on-cd') DO CALL %i FOR /f "tokens=*" %i IN ('fnm env --use-on-cd') DO CALL %i
``` ```
@ -157,7 +157,7 @@ FOR /f "tokens=*" %i IN ('fnm env --use-on-cd') DO CALL %i
### Global Options ### Global Options
``` ```sh
fnm [--shell=fish|bash|zsh] [--node-dist-mirror=URI] [--fnm-dir=DIR] [--log-level=quiet|error|info] <command> fnm [--shell=fish|bash|zsh] [--node-dist-mirror=URI] [--fnm-dir=DIR] [--log-level=quiet|error|info] <command>
``` ```
@ -221,7 +221,7 @@ PRs welcome :tada:
### Developing: ### Developing:
``` ```sh
# Install Rust # Install Rust
git clone https://github.com/Schniz/fnm.git git clone https://github.com/Schniz/fnm.git
cd fnm/ cd fnm/
@ -230,12 +230,12 @@ cargo build
### Running Binary: ### Running Binary:
``` ```sh
cargo run -- --help # Will behave like `fnm --help` cargo run -- --help # Will behave like `fnm --help`
``` ```
### Running Tests: ### Running Tests:
``` ```sh
cargo test cargo test
``` ```

Loading…
Cancel
Save