Skip to content
Discussion options

You must be logged in to vote
{{ if or (findExecutable "starship" (list "bin" "/usr/bin" ".local/bin")) (lookPath "starship") }}
    # Some logic using starship
{{ end }}

The issue that I'm facing is that chezmoi evaluates the template before starship is downloaded, so the condition fail.

Another option is to use the same logic that decides whether to install the starship external in your dot_bashprofile.tmpl instead of using findExecutable/lookPath. For example, if you always install starship then you can unconditionally always include # Some logic using starship. This way, the order of application doesn't matter and your dotfiles are more robust and declarative.

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
4 replies
@foobl42
Comment options

@foobl42
Comment options

@A2va
Comment options

@foobl42
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by A2va
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants