Skip to content

Commit

Permalink
feat!: Rename BASE_URL to OK_BASE_URL
Browse files Browse the repository at this point in the history
  • Loading branch information
yngvark committed Aug 19, 2024
1 parent 1ef232e commit bff96e2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions cmd/pkg/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ If no arguments are used, the command installs all the packages specified in the
If one or more output folders are specified, the command installs only the packages whose OutputFolder matches the specified folders. (OutputFolder is a field in the package manifest file.)
Set the environment variable BASE_URL to specify where package templates are downloaded from.
Set the environment variable ` + install.BaseUrlEnvName + ` to specify where package templates are downloaded from.
`,
Example: `ok pkg install networking
ok pkg install networking my-app
BASE_URL=../boilerplate/terraform ok install networking my-app
` + install.BaseUrlEnvName + `=../boilerplate/terraform ok pkg install networking my-app
`,
SilenceErrors: true,
RunE: func(cmd *cobra.Command, outputFolders []string) error {
Expand Down
3 changes: 2 additions & 1 deletion pkg/pkg/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ import (
"strings"
)

const BaseUrlEnvName = "OK_BASE_URL"
const DefaultBaseUrl = "[email protected]:oslokommune/golden-path-boilerplate.git//"
const DefaultPackagePathPrefix = "boilerplate/terraform"

func Run(pkgManifestFilename string, outputFolders []string) error {
baseUrlOrPath := os.Getenv("BASE_URL")
baseUrlOrPath := os.Getenv(BaseUrlEnvName)

cmds, err := CreateBoilerplateCommands(pkgManifestFilename, outputFolders, baseUrlOrPath)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions pkg/pkg/install/install_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func TestInstall(t *testing.T) {
},
},
{
testName: "Should support URL in BASE_URL",
testName: "Should support URL in OK_BASE_URL",
packageManifestFilename: "package.yml",
baseUrl: "[email protected]:oslokommune/SOMETHING_ELSE.git//",
expectBoilerplateCommands: []*exec.Cmd{
Expand All @@ -56,7 +56,7 @@ func TestInstall(t *testing.T) {
),
},
}, {
testName: "Should support file path in BASE_URL",
testName: "Should support file path in OK_BASE_URL",
packageManifestFilename: "package.yml",
baseUrl: "..",
expectBoilerplateCommands: []*exec.Cmd{
Expand Down

0 comments on commit bff96e2

Please sign in to comment.