-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add go-install arguments and env vars (#23)
* add go-install arguments and env vars Signed-off-by: Alex Goodman <[email protected]> * use slice for env var + create store dir if not exists Signed-off-by: Alex Goodman <[email protected]> --------- Signed-off-by: Alex Goodman <[email protected]>
- Loading branch information
Showing
7 changed files
with
124 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,7 +66,7 @@ func Test_templateFlags(t *testing.T) { | |
func TestInstaller_InstallTo(t *testing.T) { | ||
type fields struct { | ||
config InstallerParameters | ||
goInstallRunner func(spec, ldflags, destDir string) error | ||
goInstallRunner func(spec, ldflags string, args, env []string, destDir string) error | ||
} | ||
type args struct { | ||
version string | ||
|
@@ -88,11 +88,21 @@ func TestInstaller_InstallTo(t *testing.T) { | |
LDFlags: []string{ | ||
"-X github.com/anchore/binny/internal/version.Version={{.Version}}", | ||
}, | ||
Args: []string{ | ||
"-tags", | ||
"containers_image_openpgp", | ||
}, | ||
Env: []string{ | ||
"FOO=BAR", | ||
"BAZ=0", | ||
}, | ||
}, | ||
goInstallRunner: func(spec, ldflags, destDir string) error { | ||
goInstallRunner: func(spec, ldflags string, userArgs, userEnv []string, destDir string) error { | ||
assert.Equal(t, "github.com/anchore/binny/cmd/[email protected]", spec) | ||
assert.Equal(t, "-X github.com/anchore/binny/internal/version.Version=1.2.3", ldflags) | ||
assert.Equal(t, "/tmp/to/place", destDir) | ||
assert.Equal(t, []string{"-tags", "containers_image_openpgp"}, userArgs) | ||
assert.Equal(t, []string{"FOO=BAR", "BAZ=0"}, userEnv) | ||
return nil | ||
}, | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters