fix(init): allow alternate Iris binary
This commit is contained in:
+16
-1
@@ -41,7 +41,11 @@ func TestInitAutostartRequiresInteractiveShell(t *testing.T) {
|
||||
t.Run(shell, func(t *testing.T) {
|
||||
script := captureInitScript(t, shell)
|
||||
|
||||
head, _, found := strings.Cut(script, "exec iris")
|
||||
autostart := `exec "${IRIS_BIN:-iris}"`
|
||||
if shell == "fish" {
|
||||
autostart = `exec "$IRIS_BIN"`
|
||||
}
|
||||
head, _, found := strings.Cut(script, autostart)
|
||||
if !found {
|
||||
t.Fatalf("%s init script has no autostart", shell)
|
||||
}
|
||||
@@ -57,3 +61,14 @@ func TestInitAutostartRequiresInteractiveShell(t *testing.T) {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestInitAutostartSupportsBinaryOverride(t *testing.T) {
|
||||
for _, shell := range []string{"zsh", "bash", "fish"} {
|
||||
t.Run(shell, func(t *testing.T) {
|
||||
script := captureInitScript(t, shell)
|
||||
if !strings.Contains(script, "IRIS_BIN") {
|
||||
t.Fatalf("%s init script does not support IRIS_BIN", shell)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user