Commit Graph

1814 Commits

Author SHA1 Message Date
Trevor Brown
1ab256335f Merge pull request #69 from asdf-vm/tb/build-release-binaries
feat(golang-rewrite): build dev release binaries
2024-12-18 10:21:41 -05:00
Trevor Brown
87809c176f Merge pull request #67 from asdf-vm/tb/current-command
feat(golang-rewrite): create `asdf current` command
2024-12-18 10:21:41 -05:00
Trevor Brown
c1c0d52891 feat(golang-rewrite): build dev release binaries
* Use `wangyoucao577/go-release-action@v1` to build Go binaries for releases
* set release tag for `go-release-action`
2024-12-18 10:21:41 -05:00
Trevor Brown
2d3564534a Merge pull request #66 from asdf-vm/tb/shim-exec-2
feat(golang-rewrite): create `asdf exec` command
2024-12-18 10:21:41 -05:00
Trevor Brown
c86e84fffb feat(golang-rewrite): create asdf current command
* 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
2024-12-18 10:21:41 -05:00
Trevor Brown
a889d8369d Merge pull request #65 from asdf-vm/tb/shim-exec-1
feat(golang-rewrite): create `shims.FindExecutable` function for shim execution
2024-12-18 10:21:41 -05:00
Trevor Brown
e10dae7dc6 feat(golang-rewrite): create asdf exec command
* Add `rogpeppe/go-internal` as a dependency
* Create `exec.Exec` function
* Create asdf exec command
* Address linter warnings
2024-12-18 10:21:41 -05:00
Trevor Brown
85c5e74741 Merge pull request #64 from asdf-vm/tb/shim-generation-4
feat(golang-rewrite): use version type when generating shims
2024-12-18 10:21:41 -05:00
Trevor Brown
2817b51339 feat(golang-rewrite): create shims.FindExecutable function for shim execution
* Create primitive `toolversions.Intersect` function
* Create `paths.RemoveFromPath` function
* Create `shims.FindExecutable` function
* Write tests
2024-12-18 10:21:41 -05:00
Trevor Brown
ec156d66b9 Merge pull request #63 from asdf-vm/tb/shim-generation-3
feat(golang-rewrite): create installs and installtest packages to avoid circular dependency
2024-12-18 10:21:41 -05:00
Trevor Brown
54552f91bf feat(golang-rewrite): use version type when generating shims
* 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
2024-12-18 10:21:41 -05:00
Trevor Brown
a5609cf2f3 Merge pull request #62 from asdf-vm/tb/reorganize-go-code
feat(golang-rewrite): re-organize Go code
2024-12-18 10:21:41 -05:00
Trevor Brown
f1cec5574a feat(golang-rewrite): create installs and installtest packages to avoid circular dependency
* Correct `go test` command in GitHub test workflow
* Update execute tests to work on Github Actions
* Check in `shims/testdata` directory
* Create `installtest` helper package
* Create `installs` package
2024-12-18 10:21:41 -05:00
Trevor Brown
43cd285727 Merge pull request #61 from asdf-vm/tb/shim-generation-2
feat(golang-rewrite): shim generation 2
2024-12-18 10:21:41 -05:00
Trevor Brown
ec1fe94311 feat(golang-rewrite): re-organize Go code
* move most Go packages to internal directory
* update import paths
2024-12-18 10:21:41 -05:00
Trevor Brown
1cacaa0a70 Merge pull request #60 from asdf-vm/tb/shim-generation
feat(golang-rewrite): shim generation part 1
2024-12-18 10:21:41 -05:00
Trevor Brown
030b294234 feat(golang-rewrite): shim generation 2
* 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
2024-12-18 10:21:41 -05:00
Trevor Brown
5c5059535c Merge pull request #59 from asdf-vm/tb/install-cmd-bats-tests
feat(golang-rewrite): more work to get `install_command.bats` test passing
2024-12-18 10:21:41 -05:00
Trevor Brown
48465d4884 feat(golang-rewrite): shim generation part 1
* Add `x/sys` as a dependency
* Create `toolversions.Unique` function
* Create `shims` package with `ExecutablePaths`, `PluginExecutables`, `Write`, `GenerateForVersion` function
* Address linter warnings
2024-12-18 10:21:41 -05:00
Trevor Brown
3f12692774 Merge pull request #58 from asdf-vm/tb/bats-test-fixes
feat(golang-rewrite): BATS test fixes & `latest` command
2024-12-18 10:21:41 -05:00
Trevor Brown
fd4401494d feat(golang-rewrite): more work to get install_command.bats test passing
* Correct `logger.Printf` call
* Get `plugin_remove_command.bats` tests passing
* Enable plugin_remove_command BATS tests
* Create `versions.NoVersionSetError` struct
* Set `ASDF_CONCURRENCY` for install callbacks
2024-12-18 10:21:41 -05:00
Trevor Brown
bd9d80f49e Merge pull request #57 from asdf-vm/tb/install-command
feat(golang-rewrite): create install command
2024-12-18 10:21:41 -05:00
Trevor Brown
040df16084 feat(golang-rewrite): BATS test fixes & latest command
* Get asdf info BATS tests working
* Create `versions.Installed` function
* Update `versions.Latest` to return single version
* Implement `latest` asdf command
2024-12-18 10:21:41 -05:00
Trevor Brown
63103a0b6a Merge pull request #56 from asdf-vm/tb/latest-version
feat(golang-rewrite): create versions.Latest function
2024-12-18 10:21:41 -05:00
Trevor Brown
2de83c2ae1 feat(golang-rewrite): create install command
* Create `versions.Install` function
* Create `versions.InstallVersion` function
* Create `versions.InstallAll` function
* Improve tests
* Create install command
2024-12-18 10:21:41 -05:00
Trevor Brown
440ef9050b Merge pull request #54 from asdf-vm/tb/asdf-install-cmd
feat(golang-rewrite): create `versions.InstallOneVersion` function
2024-12-18 10:21:41 -05:00
Trevor Brown
dc08dc1a00 feat(golang-rewrite): create versions.Latest function
* Create `versions.ListAll` function
* Create `versions.Latest` function
* Update `versions.InstallOneVersion` to install latest version
2024-12-18 10:21:41 -05:00
Trevor Brown
99df51fca6 Merge pull request #53 from asdf-vm/tb/full-version-resolution
feat(golang-rewrite): full version resolution
2024-12-18 10:21:41 -05:00
Trevor Brown
beaf038dba feat(golang-rewrite): create versions.InstallOneVersion function
* Create Plugin.Exists method
* Create internal/versions package
* Add missing asdfrc for internal/resolve package tests
* Create versions.ParseString function
* Create versions.InstallOneVersion function
* Update hook package to allow hook output to be received
* Write tests
2024-12-18 10:21:41 -05:00
Trevor Brown
01ec98eef4 Merge pull request #52 from asdf-vm/tb/version-resolution
feat(golang-rewrite): create internal/resolve package
2024-12-18 10:21:41 -05:00
Trevor Brown
bd3d83092c feat(golang-rewrite): full version resolution
* 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
2024-12-18 10:21:41 -05:00
Trevor Brown
356720f610 Merge pull request #51 from asdf-vm/tb/offline-tests
feat(golang-rewrite): offline Go tests
2024-12-18 10:21:41 -05:00
Trevor Brown
30cf61a278 feat(golang-rewrite): create internal/resolve package
* Create `resolve` package
* Create `FindVersionsInDir`, `findVersionsInEnv`, and `findVersionsInLegacyFile` functions in resolve package
* Create `LegacyFilenames` and `ParseLegacyVersionFile` methods for Plugin
2024-12-18 10:21:41 -05:00
Trevor Brown
42b2f0294b Merge pull request #50 from asdf-vm/tb/version-file-parsing
feat(golang-rewrite): version file parsing
2024-12-18 10:21:41 -05:00
Trevor Brown
7533fbb5c8 feat(golang-rewrite): offline Go tests
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
2024-12-18 10:21:41 -05:00
Trevor Brown
dc9521be61 Merge pull request #49 from asdf-vm/tb/info-command
feat(golang-rewrite): info command
2024-12-18 10:21:41 -05:00
Trevor Brown
a0cd0319cb feat(golang-rewrite): version file parsing
* Create toolversions package
* Address linter errors for toolversions package
* Write tests
2024-12-18 10:21:41 -05:00
Trevor Brown
259959c6e7 Merge pull request #48 from asdf-vm/tb/plugin-callback-invocation
feat(golang-rewrite): create `RunCallback` method for `Plugin` struct
2024-12-18 10:21:41 -05:00
Trevor Brown
f657055832 feat(golang-rewrite): info command
* 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
2024-12-18 10:21:41 -05:00
Trevor Brown
2531de184a Merge pull request #45 from asdf-vm/tb/command-exec
feat(golang-rewrite): create hooks
2024-12-18 10:21:41 -05:00
Trevor Brown
f1e7c05ae3 feat(golang-rewrite): create RunCallback method for Plugin struct
* 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
2024-12-18 10:21:41 -05:00
Trevor Brown
44e8257dcf Merge pull request #44 from asdf-vm/tb/use-plugin-index
feat(golang-rewrite): use plugin index
2024-12-18 10:21:41 -05:00
Trevor Brown
b1a47fe2bf feat(golang-rewrite): create hooks
* Update tests for config package to use assert package
* Create Config.GetHook method
* Create execute package for running Bash commands
* Create hook package for running asdf hooks
* Run plugin add hooks
2024-12-18 10:21:41 -05:00
Trevor Brown
a5bc137ab3 Merge pull request #42 from asdf-vm/tb/git-code-refactor
feat(golang-rewrite): move all Git code to git package
2024-12-18 10:21:41 -05:00
Trevor Brown
1785ed8d20 feat(golang-rewrite): use plugin index
* 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
2024-12-18 10:21:41 -05:00
Trevor Brown
031419b549 Merge pull request #40 from asdf-vm/tb/plugin-repository
feat(golang-rewrite): create pluginindex package
2024-12-18 10:21:41 -05:00
Trevor Brown
8cb2918169 feat(golang-rewrite): move all Git code to git package
* 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
2024-12-18 10:21:41 -05:00
Trevor Brown
642e63a931 Merge pull request #36 from asdf-vm/tb/plugin-update-cmd
feat(golang-rewrite): create plugin update command
2024-12-18 10:21:41 -05:00
Trevor Brown
da5c91d30a feat(golang-rewrite): create 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.
2024-12-18 10:21:41 -05:00
Trevor Brown
81199ded61 Merge pull request #38 from asdf-vm/tb/setup-gofumpt
chore(golang-rewrite): setup gofumpt
2024-12-18 10:21:41 -05:00