mirror of
https://github.com/asdf-vm/asdf.git
synced 2024-12-19 01:45:04 -07:00
Compare commits
9 Commits
8f3f01870e
...
a396d73a43
Author | SHA1 | Date | |
---|---|---|---|
|
a396d73a43 | ||
|
31e8c93004 | ||
|
c778ea1dec | ||
|
98b8c6fd92 | ||
|
04fe7e30ca | ||
|
e8d6372564 | ||
|
0bbeeffc7c | ||
|
8db4c60934 | ||
|
82be580602 |
24
CHANGELOG.md
24
CHANGELOG.md
@ -1,5 +1,29 @@
|
||||
# Changelog
|
||||
|
||||
## [0.15.0](https://github.com/asdf-vm/asdf/compare/v0.14.1...v0.15.0) (2024-12-18)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* golang-rewrite: remove `asdf update` command to prepare for Go version ([#1806](https://github.com/asdf-vm/asdf/issues/1806)) ([15571a2](https://github.com/asdf-vm/asdf/commit/15571a2d28818644673bbaf0fcf7d1d9e342cda4))
|
||||
|
||||
|
||||
### Patches
|
||||
|
||||
* completions: Address two Bash completion bugs ([#1770](https://github.com/asdf-vm/asdf/issues/1770)) ([ebdb229](https://github.com/asdf-vm/asdf/commit/ebdb229ce68979a18dae5c0922620b860c56b22f))
|
||||
* make plugin-test work on alpine linux ([#1778](https://github.com/asdf-vm/asdf/issues/1778)) ([f5a1f3a](https://github.com/asdf-vm/asdf/commit/f5a1f3a0a8bb50796f6ccf618d2bf4cf3bdea097))
|
||||
* nushell: nushell spread operator ([#1777](https://github.com/asdf-vm/asdf/issues/1777)) ([a0ce37b](https://github.com/asdf-vm/asdf/commit/a0ce37b89bd5eb4ddaa806f96305ee99a8c5d365))
|
||||
* nushell: Use correct env var for shims dir ([#1742](https://github.com/asdf-vm/asdf/issues/1742)) ([2f07629](https://github.com/asdf-vm/asdf/commit/2f0762991c35da933b81ba6ab75457a504deedbb))
|
||||
* when download path got removed, it should use -f to force delete the download files ([#1746](https://github.com/asdf-vm/asdf/issues/1746)) ([221507f](https://github.com/asdf-vm/asdf/commit/221507f1c0288f0df13315a7f0f2c0a7bc39e7c2))
|
||||
|
||||
|
||||
### Documentation
|
||||
|
||||
* add Korean translation ([#1757](https://github.com/asdf-vm/asdf/issues/1757)) ([9e16306](https://github.com/asdf-vm/asdf/commit/9e16306f42b4bbffd62779aaebb9cbbc9ba59007))
|
||||
* propose edits for tiny typographical/grammatical errors ([#1747](https://github.com/asdf-vm/asdf/issues/1747)) ([d462b55](https://github.com/asdf-vm/asdf/commit/d462b55ec9868eeaddba4b70850aba908236dd93))
|
||||
* split Lint and Test badges for title asdf in `README.MD` ([#1725](https://github.com/asdf-vm/asdf/issues/1725)) ([c778ea1](https://github.com/asdf-vm/asdf/commit/c778ea1deca19d8ccd91253c2f206a6b51a0a9b1))
|
||||
* Update Japanese(ja-jp) Translations ([#1715](https://github.com/asdf-vm/asdf/issues/1715)) ([bd19e4c](https://github.com/asdf-vm/asdf/commit/bd19e4cbdc2f0a9380dbdfcec46584d619e8ed56))
|
||||
|
||||
## [0.14.1](https://github.com/asdf-vm/asdf/compare/v0.14.0...v0.14.1) (2024-08-15)
|
||||
|
||||
|
||||
|
@ -1,4 +1,6 @@
|
||||
# asdf [![Lint](https://github.com/asdf-vm/asdf/actions/workflows/lint.yml/badge.svg)](https://github.com/asdf-vm/asdf/actions/workflows/lint.yml) [![Tests](https://github.com/asdf-vm/asdf/actions/workflows/tests.yml/badge.svg)](https://github.com/asdf-vm/asdf/actions/workflows/tests.yml)
|
||||
# asdf
|
||||
|
||||
[![Lint](https://github.com/asdf-vm/asdf/actions/workflows/lint.yml/badge.svg)](https://github.com/asdf-vm/asdf/actions/workflows/lint.yml) [![Tests](https://github.com/asdf-vm/asdf/actions/workflows/tests.yml/badge.svg)](https://github.com/asdf-vm/asdf/actions/workflows/tests.yml)
|
||||
|
||||
**Manage multiple runtime versions with a single CLI tool, extendable via plugins** - [docs at asdf-vm.com](https://asdf-vm.com/)
|
||||
|
||||
|
@ -9,7 +9,7 @@ not covered under this security policy.**
|
||||
<!-- x-release-please-start-version -->
|
||||
|
||||
```
|
||||
0.14.1
|
||||
0.15.0
|
||||
```
|
||||
|
||||
<!-- x-release-please-end -->
|
||||
|
50
asdf.nu
50
asdf.nu
@ -74,6 +74,30 @@ module asdf {
|
||||
}
|
||||
}
|
||||
|
||||
def "complete asdf plugin versions all" [context: string] {
|
||||
let plugin = $context | str trim | split words | last
|
||||
^asdf list all $plugin
|
||||
| lines
|
||||
| each { |line| $line | str trim }
|
||||
| prepend "latest"
|
||||
}
|
||||
|
||||
def "complete asdf plugin versions installed" [context: string] {
|
||||
let plugin = $context | str trim | split words | last
|
||||
let versions = ^asdf list $plugin
|
||||
| lines
|
||||
| each { |line| $line | str trim }
|
||||
| each { |version| if ($version | str starts-with "*") {{value: ($version | str substring 1..), description: "current version"}} else {{value: $version, description: ""}} }
|
||||
|
||||
let latest = ^asdf latest $plugin | str trim
|
||||
|
||||
if ($versions | get value | any {|el| $el == $latest}) {
|
||||
$versions | prepend {value: "latest", description: $"alias to ($latest)"}
|
||||
} else {
|
||||
$versions
|
||||
}
|
||||
}
|
||||
|
||||
# ASDF version manager
|
||||
export extern main [
|
||||
subcommand?: string@"complete asdf sub-commands"
|
||||
@ -145,15 +169,15 @@ module asdf {
|
||||
|
||||
# install a package version
|
||||
export extern "asdf install" [
|
||||
name?: string # Name of the package
|
||||
version?: string # Version of the package or latest
|
||||
name?: string@"complete asdf installed plugins" # Name of the package
|
||||
version?: string@"complete asdf plugin versions all" # Version of the package or latest
|
||||
]
|
||||
|
||||
|
||||
# Remove an installed package version
|
||||
export extern "asdf uninstall" [
|
||||
name: string@"complete asdf installed" # Name of the package
|
||||
version: string # Version of the package
|
||||
version: string@"complete asdf plugin versions installed" # Version of the package
|
||||
]
|
||||
|
||||
# Display current version
|
||||
@ -169,31 +193,31 @@ module asdf {
|
||||
# Display install path for an installled package version
|
||||
export extern "asdf where" [
|
||||
name: string@"complete asdf installed" # Name of installed package
|
||||
version?: string # Version of installed package
|
||||
version?: string@"complete asdf plugin versions installed" # Version of installed package
|
||||
]
|
||||
|
||||
# Set the package local version
|
||||
export extern "asdf local" [
|
||||
name: string@"complete asdf installed" # Name of the package
|
||||
version?: string # Version of the package or latest
|
||||
version?: string@"complete asdf plugin versions installed" # Version of the package or latest
|
||||
]
|
||||
|
||||
# Set the package global version
|
||||
export extern "asdf global" [
|
||||
name: string@"complete asdf installed" # Name of the package
|
||||
version?: string # Version of the package or latest
|
||||
version?: string@"complete asdf plugin versions installed" # Version of the package or latest
|
||||
]
|
||||
|
||||
# Set the package to version in the current shell
|
||||
export extern "asdf shell" [
|
||||
name: string@"complete asdf installed" # Name of the package
|
||||
version?: string # Version of the package or latest
|
||||
version?: string@"complete asdf plugin versions installed" # Version of the package or latest
|
||||
]
|
||||
|
||||
# Show latest stable version of a package
|
||||
export extern "asdf latest" [
|
||||
name: string # Name of the package
|
||||
version?: string # Filter latest stable version from this version
|
||||
name: string@"complete asdf installed" # Name of the package
|
||||
version?: string@"complete asdf plugin versions installed" # Filter latest stable version from this version
|
||||
]
|
||||
|
||||
# Show latest stable version for all installed packages
|
||||
@ -202,13 +226,13 @@ module asdf {
|
||||
# List installed package versions
|
||||
export extern "asdf list" [
|
||||
name?: string@"complete asdf installed" # Name of the package
|
||||
version?: string # Filter the version
|
||||
version?: string@"complete asdf plugin versions installed" # Filter the version
|
||||
]
|
||||
|
||||
# List all available package versions
|
||||
export def "asdf list all" [
|
||||
name: string@"complete asdf installed" # Name of the package
|
||||
version?: string="" # Filter the version
|
||||
version?: string@"complete asdf plugin versions installed"="" # Filter the version
|
||||
] {
|
||||
^asdf list all $name $version | lines | parse "{version}" | str trim
|
||||
}
|
||||
@ -216,7 +240,7 @@ module asdf {
|
||||
# Show documentation for plugin
|
||||
export extern "asdf help" [
|
||||
name: string@"complete asdf installed" # Name of the plugin
|
||||
version?: string # Version of the plugin
|
||||
version?: string@"complete asdf plugin versions installed" # Version of the plugin
|
||||
]
|
||||
|
||||
# Execute a command shim for the current version
|
||||
@ -237,7 +261,7 @@ module asdf {
|
||||
# Recreate shims for version package
|
||||
export extern "asdf reshim" [
|
||||
name?: string@"complete asdf installed" # Name of the package
|
||||
version?: string # Version of the package
|
||||
version?: string@"complete asdf plugin versions installed" # Version of the package
|
||||
]
|
||||
|
||||
# List the plugins and versions that provide a command
|
||||
|
@ -36,7 +36,7 @@ asdf primarily requires `git` & `curl`. Here is a _non-exhaustive_ list of comma
|
||||
|
||||
|
||||
```shell
|
||||
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.14.1
|
||||
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.15.0
|
||||
|
||||
```
|
||||
|
||||
|
@ -39,7 +39,7 @@ asdf primarily requires `git` & `curl`. Here is a _non-exhaustive_ list of comma
|
||||
<!-- x-release-please-start-version -->
|
||||
|
||||
```shell
|
||||
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.14.1
|
||||
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.15.0
|
||||
```
|
||||
|
||||
<!-- x-release-please-end -->
|
||||
|
@ -35,7 +35,7 @@ asdf primarily requires `git` & `curl`. Here is a _non-exhaustive_ list of comma
|
||||
<!-- x-release-please-start-version -->
|
||||
|
||||
```shell
|
||||
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.14.1
|
||||
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.15.0
|
||||
```
|
||||
|
||||
<!-- x-release-please-end -->
|
||||
|
@ -3,7 +3,11 @@
|
||||
shim_exec_command() {
|
||||
local shim_name
|
||||
shim_name=$(basename "$1")
|
||||
local shim_args=("${@:2}")
|
||||
|
||||
local shim_args=()
|
||||
if [ $# -gt 1 ]; then
|
||||
shim_args=("${@:2}")
|
||||
fi
|
||||
|
||||
if [ -z "$shim_name" ]; then
|
||||
printf "usage: asdf exec <command>\n"
|
||||
@ -20,12 +24,25 @@ shim_exec_command() {
|
||||
exit 2
|
||||
fi
|
||||
|
||||
asdf_run_hook "pre_${plugin_name}_${shim_name}" "${shim_args[@]}"
|
||||
pre_status=$?
|
||||
# Check if array is empty before using it
|
||||
if [ ${#shim_args[@]} -eq 0 ]; then
|
||||
asdf_run_hook "pre_${plugin_name}_${shim_name}"
|
||||
pre_status=$?
|
||||
else
|
||||
asdf_run_hook "pre_${plugin_name}_${shim_name}" "${shim_args[@]}"
|
||||
pre_status=$?
|
||||
fi
|
||||
|
||||
if [ "$pre_status" -ne 0 ]; then
|
||||
return "$pre_status"
|
||||
fi
|
||||
exec "$executable_path" "${shim_args[@]}"
|
||||
|
||||
# Check if array is empty before using it
|
||||
if [ ${#shim_args[@]} -eq 0 ]; then
|
||||
exec "$executable_path"
|
||||
else
|
||||
exec "$executable_path" "${shim_args[@]}"
|
||||
fi
|
||||
}
|
||||
|
||||
with_shim_executable "$shim_name" exec_shim || exit $?
|
||||
|
@ -1 +1 @@
|
||||
0.14.1
|
||||
0.15.0
|
||||
|
Loading…
Reference in New Issue
Block a user