mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-03-05 20:49:04 -08:00
fix: do not run shell command when shell isn't available
This commit is contained in:
parent
d3207328e5
commit
71d84e64df
|
@ -17,6 +17,9 @@ const (
|
||||||
|
|
||||||
func (c *command) enabled() bool {
|
func (c *command) enabled() bool {
|
||||||
shell := c.props.getString(ExecutableShell, "bash")
|
shell := c.props.getString(ExecutableShell, "bash")
|
||||||
|
if !c.env.hasCommand(shell) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
command := c.props.getString(Command, "echo no command specified")
|
command := c.props.getString(Command, "echo no command specified")
|
||||||
if strings.Contains(command, "||") {
|
if strings.Contains(command, "||") {
|
||||||
commands := strings.Split(command, "||")
|
commands := strings.Split(command, "||")
|
||||||
|
|
Loading…
Reference in a new issue