Skip to content

Commit 441ec6c

Browse files
Merge pull request #264 from paketo-buildpacks/fix-chars
Do not use effect.NewExecutor use CommandExecutor instead
2 parents 707f60d + a8e4263 commit 441ec6c

File tree

4 files changed

+9
-10
lines changed

4 files changed

+9
-10
lines changed

lein/build.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ func (b Build) Build(context libcnb.BuildContext) (libcnb.BuildResult, error) {
102102
InterestingFileDetector: libbs.AlwaysInterestingFileDetector{},
103103
}
104104

105-
sbomScanner := sbom.NewSyftCLISBOMScanner(context.Layers, effect.NewExecutor(), b.Logger)
105+
sbomScanner := sbom.NewSyftCLISBOMScanner(context.Layers, effect.CommandExecutor{}, b.Logger)
106106

107107
a, err := b.ApplicationFactory.NewApplication(
108108
map[string]interface{}{},

lein/build_test.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
package lein_test
1818

1919
import (
20-
"io/ioutil"
2120
"os"
2221
"path/filepath"
2322
"testing"
@@ -43,12 +42,14 @@ func testBuild(t *testing.T, context spec.G, it spec.S) {
4342
it.Before(func() {
4443
var err error
4544

46-
ctx.Application.Path, err = ioutil.TempDir("", "build-application")
45+
ctx.Application.Path, err = os.MkdirTemp("", "build-application")
4746
Expect(err).NotTo(HaveOccurred())
4847

49-
ctx.Layers.Path, err = ioutil.TempDir("", "build-layers")
48+
ctx.Layers.Path, err = os.MkdirTemp("", "build-layers")
5049
Expect(err).NotTo(HaveOccurred())
5150
leinBuild = lein.Build{ApplicationFactory: &FakeApplicationFactory{}}
51+
52+
t.Setenv("BP_ARCH", "amd64")
5253
})
5354

5455
it.After(func() {
@@ -57,7 +58,7 @@ func testBuild(t *testing.T, context spec.G, it spec.S) {
5758
})
5859

5960
it("does not contribute distribution if wrapper exists", func() {
60-
Expect(ioutil.WriteFile(filepath.Join(ctx.Application.Path, "lein"), []byte{}, 0644)).To(Succeed())
61+
Expect(os.WriteFile(filepath.Join(ctx.Application.Path, "lein"), []byte{}, 0644)).To(Succeed())
6162
ctx.StackID = "test-stack-id"
6263

6364
result, err := leinBuild.Build(ctx)

lein/detect_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
package lein_test
1818

1919
import (
20-
"io/ioutil"
2120
"os"
2221
"path/filepath"
2322
"testing"
@@ -40,7 +39,7 @@ func testDetect(t *testing.T, context spec.G, it spec.S) {
4039
it.Before(func() {
4140
var err error
4241

43-
ctx.Application.Path, err = ioutil.TempDir("", "lein")
42+
ctx.Application.Path, err = os.MkdirTemp("", "lein")
4443
Expect(err).NotTo(HaveOccurred())
4544
})
4645

@@ -53,7 +52,7 @@ func testDetect(t *testing.T, context spec.G, it spec.S) {
5352
})
5453

5554
it("passes with project.clj", func() {
56-
Expect(ioutil.WriteFile(filepath.Join(ctx.Application.Path, "project.clj"), []byte{}, 0644))
55+
Expect(os.WriteFile(filepath.Join(ctx.Application.Path, "project.clj"), []byte{}, 0644))
5756

5857
Expect(detect.Detect(ctx)).To(Equal(libcnb.DetectResult{
5958
Pass: true,

lein/distribution_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
package lein_test
1818

1919
import (
20-
"io/ioutil"
2120
"os"
2221
"path/filepath"
2322
"testing"
@@ -42,7 +41,7 @@ func testDistribution(t *testing.T, context spec.G, it spec.S) {
4241

4342
Expect(err).NotTo(HaveOccurred())
4443

45-
ctx.Layers.Path, err = ioutil.TempDir("", "distribution-layers")
44+
ctx.Layers.Path, err = os.MkdirTemp("", "distribution-layers")
4645
Expect(err).NotTo(HaveOccurred())
4746
})
4847

0 commit comments

Comments
 (0)