Skip to content

Commit 2bd35bc

Browse files
authored
Fix plugin for v0.16 of asdf and lts resolution (#417)
* fix: remove bash extension in cmds, fix resolve +x * fix: fix lts resolution and cmd names * fix: update README to reflect v0.16 subcommands * fix: node version in README
1 parent 84a4d6d commit 2bd35bc

File tree

5 files changed

+17
-14
lines changed

5 files changed

+17
-14
lines changed

README.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ You can specify a non-default location of this file by setting a `ASDF_NPM_DEFAU
110110
We provide a command for running the installed `node-build` command:
111111

112112
```bash
113-
asdf nodejs nodebuild --version
113+
asdf cmd nodejs nodebuild --version
114114
```
115115

116116
### node-build advanced variations
@@ -122,7 +122,7 @@ Some of them will work out of the box, and some will need a bit of investigation
122122
To list all the available variations run:
123123

124124
```bash
125-
asdf nodejs nodebuild --definitions
125+
asdf cmd nodejs nodebuild --definitions
126126
```
127127

128128
_Note that this command only lists the current `node-build` definitions. You might want to [update the local `node-build` repository](#updating-node-build-definitions) before listing them._
@@ -132,7 +132,7 @@ _Note that this command only lists the current `node-build` definitions. You mig
132132
Every new node version needs to have a definition file in the `node-build` repository. `asdf-nodejs` already tries to update `node-build` on every new version installation, but if you want to update `node-build` manually for some reason we provide a command just for that:
133133

134134
```bash
135-
asdf nodejs update-nodebuild
135+
asdf cmd nodejs update-nodebuild
136136
```
137137

138138
### Integrity/signature check
@@ -141,21 +141,24 @@ In the past `asdf-nodejs` checked for signatures and integrity by querying live
141141

142142
### Resolving latest available LTS version in a script
143143

144-
This plugin adds a custom subcommand `asdf nodejs resolve lts`. If you want to know what is the latest available LTS major version number you can do this:
144+
This plugin adds a custom subcommand `asdf cmd nodejs resolve lts`. If you want to know what is the latest available LTS major version number you can do this:
145+
145146
```sh
146147
# Before checking for aliases, update nodebuild to check for newly releasead versions
147-
asdf nodejs update-nodebuild
148+
asdf cmd nodejs update-nodebuild
148149

149-
asdf nodejs resolve lts
150-
# outputs: 22.11.0
150+
asdf cmd nodejs resolve lts
151+
# outputs: 22.13.1
151152
```
153+
152154
You also have the option of forcing a resolution strategy by using the flags `--latest-installed` and `--latest-available`
155+
153156
```bash
154157
# Outputs the latest version installed locally which is a LTS
155-
asdf nodejs resolve lts --latest-installed
158+
asdf cmd nodejs resolve lts --latest-installed
156159

157160
# Outputs the latest version available for download which is a LTS
158-
asdf nodejs resolve lts --latest-available
161+
asdf cmd nodejs resolve lts --latest-available
159162
```
160163

161164
## Corepack
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! /usr/bin/env bash
1+
#!/usr/bin/env bash
22

33
set -eu -o pipefail
44

lib/commands/command-resolve

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! /usr/bin/env bash
1+
#!/usr/bin/env bash
22

33
set -eu -o pipefail
44

lib/commands/command-update-nodebuild.bash renamed to lib/commands/command-update-nodebuild

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! /usr/bin/env bash
1+
#!/usr/bin/env bash
22

33
set -eu -o pipefail
44

lib/utils.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ colored() {
4141
export RED=31 GREEN=32 YELLOW=33 BLUE=34 MAGENTA=35 CYAN=36
4242

4343
nodebuild_wrapped() {
44-
"$ASDF_NODEJS_PLUGIN_DIR/lib/commands/command-nodebuild.bash" "$@"
44+
"$ASDF_NODEJS_PLUGIN_DIR/lib/commands/command-nodebuild" "$@"
4545
}
4646

4747
try_to_update_nodebuild() {
@@ -51,7 +51,7 @@ try_to_update_nodebuild() {
5151

5252
local exit_code=0
5353

54-
"$ASDF_NODEJS_PLUGIN_DIR/lib/commands/command-update-nodebuild.bash" 2>/dev/null || exit_code=$?
54+
"$ASDF_NODEJS_PLUGIN_DIR/lib/commands/command-update-nodebuild" 2>/dev/null || exit_code=$?
5555

5656
if [ "$exit_code" != 0 ]; then
5757
printf "

0 commit comments

Comments
 (0)