Skip to content

Offline mode for .chezmoiexternal #4178

Answered by twpayne
2-4601 asked this question in Q&A
Discussion options

You must be logged in to vote

You can use templating to disable .chezmoiexternals when an environment variable is set, for example:

{{ if not (env "OFFLINE") }}

["games/gzdoom/autoautosave.pk3"]
type = "file"
url = "{{ gitHubLatestReleaseAssetURL "mmaulwurff/autoautosave" "autoautosave-*.pk3" }}"
refreshPeriod = "{{ mul 24 7 }}h"

{{ end }}

Then set the $OFFLINE environment variable when you want to run chezmoi without network access, e.g.

$ OFFLINE=1 chezmoi apply

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@2-4601
Comment options

Answer selected by 2-4601
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants