Skip to content

Commit

Permalink
Merge pull request #9 from MTVersionManager/shortparams
Browse files Browse the repository at this point in the history
Shorten function parameters
  • Loading branch information
leomick authored Nov 30, 2024
2 parents 82ddfc0 + ba69e2c commit 5097ca9
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cmd/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type installModel struct {
pluginName string
}

func installInitialModel(plugin mtvmplugin.Plugin, pluginName string, version string) installModel {
func installInitialModel(plugin mtvmplugin.Plugin, pluginName, version string) installModel {
downloadModel := install.New(plugin, pluginName, version)
return installModel{
installer: downloadModel,
Expand Down
2 changes: 1 addition & 1 deletion cmd/remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type removeModel struct {
done bool
}

func removeInitialModel(plugin mtvmplugin.Plugin, version string, tool string) removeModel {
func removeInitialModel(plugin mtvmplugin.Plugin, version, tool string) removeModel {
spin := spinner.New()
spin.Spinner = spinner.Dot
return removeModel{
Expand Down
2 changes: 1 addition & 1 deletion cmd/use.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type useInstallModel struct {
version string
}

func useInstallInitialModel(plugin mtvmplugin.Plugin, pluginName string, version string) useInstallModel {
func useInstallInitialModel(plugin mtvmplugin.Plugin, pluginName, version string) useInstallModel {
installer := install.New(plugin, pluginName, version)
spin := spinner.New()
spin.Spinner = spinner.Dot
Expand Down
4 changes: 2 additions & 2 deletions components/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type Model struct {

type InstalledMsg bool

func New(plugin mtvmplugin.Plugin, pluginName string, version string) Model {
func New(plugin mtvmplugin.Plugin, pluginName, version string) Model {
progressChannel := make(chan float64)
downloader := downloadProgress.New(progressChannel)
downloader.Title = "Downloading..."
Expand Down Expand Up @@ -53,7 +53,7 @@ func Download(plugin mtvmplugin.Plugin, version string, progressChannel chan flo
}
}

func Install(plugin mtvmplugin.Plugin, installDir string, pluginName string, version string) tea.Cmd {
func Install(plugin mtvmplugin.Plugin, installDir string, pluginName, version string) tea.Cmd {
return func() tea.Msg {
err := plugin.Install(filepath.Join(installDir, pluginName, version))
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion shared/shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type SuccessMsg string

var CheckMark string = lipgloss.NewStyle().Foreground(lipgloss.Color("2")).SetString("✓").String()

func IsVersionInstalled(tool string, version string) (bool, error) {
func IsVersionInstalled(tool, version string) (bool, error) {
_, err := os.Stat(filepath.Join(Configuration.InstallDir, tool, version))
if err != nil {
if os.IsNotExist(err) {
Expand Down

0 comments on commit 5097ca9

Please sign in to comment.