Skip to content

Commit 4b6bf31

Browse files
authored
feat(cli): jb binary environment variable (#272)
Adds and environment variable TANKA_JB_PATH, to provide the location of the jb executable on the system. If unset, Tanka will search $PATH, as it did before.
1 parent 6941b87 commit 4b6bf31

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

cmd/tk/init.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,12 @@ func initCmd() *cli.Command {
7171
}
7272

7373
func installK8sLib() error {
74-
if _, err := exec.LookPath("jb"); err != nil {
74+
jbBinary := "jb"
75+
if env := os.Getenv("TANKA_JB_PATH"); env != "" {
76+
jbBinary = env
77+
}
78+
79+
if _, err := exec.LookPath(jbBinary); err != nil {
7580
return errors.New("jsonnet-bundler not found in $PATH. Follow https://tanka.dev/install#jsonnet-bundler for installation instructions")
7681
}
7782

docs/docs/env-vars.md

+5
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ route: "/env-vars"
55

66
# Environment Variables
77

8+
### TANKA_JB_PATH
9+
10+
**Description**: Path to the `jb` tool executable
11+
**Default**: `$PATH/jb`
12+
813
### TANKA_KUBECTL_PATH
914

1015
**Description**: Path to the `kubectl` tool executable

0 commit comments

Comments
 (0)