Skip to content

Commit

Permalink
Add ArchMatcher
Browse files Browse the repository at this point in the history
  • Loading branch information
shiv3 committed Jul 29, 2021
1 parent 5fe1d54 commit 31e8636
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
7 changes: 6 additions & 1 deletion domain/installer/installer.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ func NewInstaller(installType InstallType, installConfig InstallConfig) Installe
case InstallTypeGoInstall:
return NewInstallerGoInstall(InstallTypeGoInstall, installConfig)
case InstallTypeGitHubReleaseZip:
return NewInstallerGithubReleaseZip(InstallTypeGitHubReleaseZip, installConfig)
return NewInstallerGithubReleaseZip(InstallTypeGitHubReleaseZip, installConfig, map[string]string{
"darwin/386": "osx-x86_64",
"darwin/amd64": "osx-x86_64",
"linux/386": "linux-x86_32",
"linux/amd64": "linux-x86_64",
})
}
return nil
}
Expand Down
4 changes: 2 additions & 2 deletions domain/installer/installer_github_release.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ type InstallerGithubReleaseZip struct {
ArchMatcher map[string]string
}

func NewInstallerGithubReleaseZip(installType InstallType, installConfig InstallConfig) *InstallerGithubReleaseZip {
return &InstallerGithubReleaseZip{InstallType: installType, InstallConfig: installConfig}
func NewInstallerGithubReleaseZip(installType InstallType, installConfig InstallConfig, archMatcher map[string]string) *InstallerGithubReleaseZip {
return &InstallerGithubReleaseZip{InstallType: installType, InstallConfig: installConfig, ArchMatcher: archMatcher}
}

func (i *InstallerGithubReleaseZip) Install(ctx context.Context, options ...InstallOption) error {
Expand Down
8 changes: 5 additions & 3 deletions example/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
FROM golang:1.16

WORKDIR /
RUN go install github.com/shiv3/protoenv@latest
WORKDIR /root
RUN go install github.com/shiv3/protoenv@v0.0.2

RUN mkdir -p .protoenv/protoc
RUN protoenv protoc init
RUN protoenv protoc install v3.17.3
RUN protoenv plugins protoc-gen-go install v1.20.0
RUN protoenv plugins protoc-gen-go install v1.26

0 comments on commit 31e8636

Please sign in to comment.