Skip to content

Commit

Permalink
Merge pull request #13 from ninech/export-webroot-env
Browse files Browse the repository at this point in the history
feat: export WebRootEnv
  • Loading branch information
ctrox authored Apr 23, 2024
2 parents 8bb0706 + 700582c commit 0fdfecb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions detect.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

const (
indexFile = "index.html"
webRootEnv = "BP_STATIC_WEBROOT"
WebRootEnv = "BP_STATIC_WEBROOT"
)

type BuildPlanMetadata struct {
Expand Down Expand Up @@ -44,7 +44,7 @@ func Detect(logger scribe.Emitter) packit.DetectFunc {

func WebRoot(workingDir string) (string, error) {
// the webroot can be set using an env var
if v, ok := os.LookupEnv(webRootEnv); ok {
if v, ok := os.LookupEnv(WebRootEnv); ok {
return v, nil
}

Expand Down
2 changes: 1 addition & 1 deletion detect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func testDetect(t *testing.T, context spec.G, it spec.S) {

context("when webroot is set via env", func() {
it.Before(func() {
t.Setenv(webRootEnv, "custom")
t.Setenv(WebRootEnv, "custom")
})

it("requires nginx", func() {
Expand Down

0 comments on commit 0fdfecb

Please sign in to comment.