* Add `asdf completion` command
* Move completion files to `cli/completions`
* Add completions for Bash, Zsh, Fish, Elvish, and Nushell
* Update Zsh completion code to work with new completion install method
* Remove old commands from help output
* Add message to `asdf update` command
* Explain why `asdf global` and `asdf local` have been removed
* Add reference argument to `git.Repoer.Clone` method
* Update `asdf plugin test` command to install specific ref of plugin if provided
* Update `asdf plugin update` command to run pre and post plugin update hooks, and `post-plugin-update` plugin callback
* Enable `plugin_update_command.bats` tests
* Correct the environment `bin/install` runs in
* Improve output of `asdf list all` command when plugin not found
* Update `asdf plugin test` command to install a tool version in the test
* Replace direct `fmt.Println()` usage in a test with `t.Log()`
* Rename `cmd` to `cli`
* Move asdf command from module root
* Fix some linter warnings, thus enabling some tests that were being skipped
* Fix `Makefile`
* Rename module to `github.com/asdf-vm/asdf`
* Fix `TestGetAllToolsAndVersionsInContent/returns_empty_list_with_found_true_and_no_error_when_empty_content`
* Rewrite `Unique()` to be a bit more straightforwards
* Get workflow checks passing again
toolversions.Unique is ever so slightly faster, technically.
```
goos: linux
goarch: amd64
pkg: github.com/asdf-vm/asdf/internal/toolversions
cpu: AMD Ryzen 9 3900X 12-Core Processor
│ /tmp/old.txt │ /tmp/new.txt │
│ sec/op │ sec/op vs base │
Unique-24 346.5n ± 1% 342.4n ± 1% -1.17% (p=0.027 n=10)
│ /tmp/old.txt │ /tmp/new.txt │
│ B/op │ B/op vs base │
Unique-24 160.0 ± 0% 160.0 ± 0% ~ (p=1.000 n=10) ¹
¹ all samples are equal
│ /tmp/old.txt │ /tmp/new.txt │
│ allocs/op │ allocs/op vs base │
Unique-24 3.000 ± 0% 3.000 ± 0% ~ (p=1.000 n=10) ¹
¹ all samples are equal
```
* Enable `install_command.bats` tests
* Update `versions.InstallVersion` function to accept `toolversions.Version` struct
* Remove download directory after install if not configured to keep it
* Add download callback requirement to list of breaking changes
* Add `--keep-download` flag to install command
* Get all `install_command.bats` tests passing
* Create `toolversions.ParseSlice` function
* Create `toolversions.Format` function
* Refactor `shims` package to use `toolversions.Version` struct
* Fix handling of path versions in `shims.FindExecutable` function
* Create `CurrentEnv` and `MergeEnv` helper functions
* Add another test for `paths.RemoveFromPath` function
* Move executable finding functions to shims package
* Correct PATH code for env and exec commands
* Create `CallbackPath` method on `Plugin` struct
* Correct behavior of `asdf shimversions` command
* Update `shims.FindExecutable` function to return plugin
* Create `repotest.WritePluginCallback` function
* Create `execenv` package for invoking `exec-env` plugin callback
* Make `MapToSlice` a public function
* Return resolved version from `shims.FindExecutable` function
* Create `shims.ExecutablePaths` function
* Enable `shim_env_command.bats` tests
* Implement `asdf env` command
* create `repotest.WritePluginCallback` function
* add test for `list-bin-paths` callback that returns non-existent path
* if directory name returned by `list-bin-paths` doesn't exist skip it
* Create asdf-version script to print formatted version
* Update Makefile to set main.version variable during build
* Improve help output formatting
* Update release-build workflow to set asdf version in binaries
* Get more shim_exec.bats tests passing by adding shebang lines to test scripts
* Disable shim_exec test case for scenario that is no longer possible
* Add documentation on another breaking change
* Create toolversions.Version struct and update code to use new struct
* Enable `remove_command.bats` tests
* Update `remove_command.bats` to use new command name
* Create `internal/data` package
* Use data package for install paths
* Get all asdf plugin remove command BATS tests passing
* Enable `asdf list` BATS tests
* Update list_command.bats code to use non-hyphenated version of list all command
* Implement `asdf list all` command
* Implement `asdf list` command
* Enable asdf uninstall BATS tests
* Create `toolversions.ParseFromCliArg` function
* Create `versions.Uninstall` function
* Update `ParseFromCliArg` function to handle latest version without optional filter value
* Create `asdf uninstall` command
* Comment out invalid test
* Address linter warnings
* Move `versions.ParseString` function to the toolversions package
* Create `toolversions.FormatForFS` function
* use new `toolversions.FormatForFS` function
* Create `asdf where` command
* Enable BATS tests for `asdf where` command
* Create help package
* Add help command
* Enable help command BATS tests
* Implement functions in help package
* Write tests
* Correct function call in `installPlugin` test helper in shims package
* create asdf which command
* enable which_command.bats tests
* add more info to NoExecutableForPluginError
* Write tests for shims.GetExecutablePath function
* Use plugin `exec-path` callback when present to compute executable
path
* Create asdf current command
* Correct output of asdf exec command when no command is provided
* Enable current_command.bats tests
* Fix current_command.bats test code
* Generate shims after version install
* Enable `reshim_command.bats` tests
* Remove `update_command.bats` tests from main_test.go
* Update `installs` package functions to accept version type in addition to version value
* Update `versions.ParseString` function to handle path version
* Move invocation of hooks for reshim
* Update `asdf reshim` command so shims can be generated for path versions
* Rename `versions.Installed` function to `IsInstalled`
* Create `versions.Installed` function
* Create `shims.GenerateForPluginVersions` and `shims.GenerateAll` functions
* Address linter warnings
* Create asdf reshim command
* Run asdf hook from new `shims` functions
* Add `x/sys` as a dependency
* Create `toolversions.Unique` function
* Create `shims` package with `ExecutablePaths`, `PluginExecutables`, `Write`, `GenerateForVersion` function
* Address linter warnings
* Get asdf info BATS tests working
* Create `versions.Installed` function
* Update `versions.Latest` to return single version
* Implement `latest` asdf command
* Refactor config package so default settings are always used with config file not loaded
* Update `findVersionsInDir` to check legacy files
* Refactor functions in internal/resolve package to return `ToolVersion` structs instead of version slices
* Refactor `findVersionsInEnv` function to return env variable name
* Create `resolve.Version` function
Some of the Go tests actually cloned remote repos, which meant slow tests, and tests failures if I was working offline. These changes allow all Go tests to run offline. The test code now clones local Git repos instead of remotes ones.
* Add otiai10/copy as a dependency
* Create repotest package for test code that needs to work with Git repos
* Add back missing test script for execute package
* Update git, pluginindex, and plugins package tests so they work offline
* Implement info command
* Remove duplicate and unneeded BATS tests from `main_test.go`
* remove download dir for plugin when removing plugin
* update plugins.Add function so downloads directory is created
* Create `plugins.New` function, updating existing code to use it
* Add another test for `hook.Run` function
* Enable `plugin_add_command.bats` tests for Go implementation of asdf
* Add `RunCallback` method to `Plugin` struct
* Update `plugins.Add` function to run `post-plugin-add` plugin callback script
* Handle Bash expression and scripts properly in `execute` package so `$@` is always set
* Create `pluginindex.Build` function
* Use `pluginindex` when no plugin URL provided for plugin add command
* Get more `plugin_add_command` BATS tests passing against Golang version
* Only use `pluginindex` when it is not disabled
* Update error message so it matches legacy format
* Add staticcheck.conf
* Move plugins/git package to /git.
* Update repoer interface in pluginindex package to match interface in git package
* Use git package's Repo struct in pluginindex package
* Switch to non-verbose test output in Makefile
* Create pluginindex package with PluginIndex struct with methods for updating index and retrieving plugin URLs
* Create IndexRepo interface to allow for easy testing out cloning real Git repository.
* Simplify BATS test Golang code
* Update plugin add test to new command format
* Correctly set `ASDF_DATA_DIR` for BATS tests
* Rename `PluginAdd` function to `Add`
* Create `plugin.Remove` function
* Make plugin remove command invoke `plugin.Remove` function
* remove underscores from function names (addresses warnings from revive linter)
* create installMockPluginRepo function
* implement plugin list command
* Add go-git as a dependency
* Remove plugins dir from gitignore
* Move config code to config package
* Create validatePluginName function
* Create PluginDirectory function
* Create PluginExists function
* Implement PluginAdd function
* Add testify as a dependency
* Write test for PluginAdd happy path
* Create PluginRepoCheckDuration struct to represent config value
* Make some functions private
* write basic tests for Config methods
* Add Loaded field to Settings struct
* Define constants for config default values
* rename commands package to cmd
* add go-ini as a dependency
* write code to parse asdfrc file into Settings struct
* add go-envconfig as a dependency
* add go-homedir as a dependency
* implement first version of LoadConfig function to load environment variables into Config struct
Improved completions for commands such as `asdf global <name> <version>` to list the installed versions
Added "complete asdf plugin versions installed" and "complete asdf plugin versions all" that produce completions for the installed versions and for all versions available for a given plugin
Improved `asdf install` completion to list the installed plugins and all the available versions
2024-06-01 17:40:04 -03:00
16 changed files with 529 additions and 27 deletions
* 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: 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))
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.