Skip to content

[Question] Conditionally set file extension? #3963

Answered by halostatue
Ajaymamtora asked this question in Q&A
Discussion options

You must be logged in to vote

No, there is not.

There are a few options available to you:

  • Scripts can be ignored in .chezmoiignore.tmpl just as they do to other files (see twpayne/dotfiles/home/.chezmoiignore.tmpl (this prevents the Windows one from running on Linux, but does not unify the scripts).

  • A version of bash can be installed on Windows (this can potentially unify the scripts).

  • A version of PowerShell can be installed on Linux (this can potentially unify the scripts).

  • Your script can be written in a different common language (Ruby, Python, Tcl, whatever) with the appropriate interpreter installed (unifying the scripts).

  • You can always call the file .ps1.tmpl but do something like:

    {{- if eq .chezmoi.…

Replies: 2 comments 1 reply

This comment was marked as off-topic.

@fochoa8

This comment was marked as off-topic.

Comment options

You must be logged in to vote
0 replies
Answer selected by halostatue
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