Skip to content

Commit

Permalink
jb binary env var fix
Browse files Browse the repository at this point in the history
  • Loading branch information
qckzr committed May 6, 2020
1 parent 6941b87 commit 303257d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmd/tk/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,12 @@ func initCmd() *cli.Command {
}

func installK8sLib() error {
if _, err := exec.LookPath("jb"); err != nil {
jbBinary := "jb"
if env := os.Getenv("TANKA_JB_PATH"); env != "" {
jbBinary = env
}

if _, err := exec.LookPath(jbBinary); err != nil {
return errors.New("jsonnet-bundler not found in $PATH. Follow https://tanka.dev/install#jsonnet-bundler for installation instructions")
}

Expand Down
5 changes: 5 additions & 0 deletions docs/docs/env-vars.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ route: "/env-vars"
**Description**: Path to the `kubectl` tool executable
**Default**: `$PATH/kubectl`

### TANKA_JB_PATH

**Description**: Path to the `jb` tool executable
**Default**: `$PATH/jb`

### TANKA_KUBECTL_TRACE

**Description**: Print all calls to `kubectl`
Expand Down

0 comments on commit 303257d

Please sign in to comment.