Comments (5)
I wish there was a way to specify the order of apply, or there is some other way to solve it.
I would suggest the following:
- In your
.chezmoiexternal
file, exclude.config/xx
if you're runningchezmoi init
:
# .chezmoiexternal.tompl
{{ if not has "init" .chezmoi.args }}
[".config/xx"]
type = "git-repo"
url = "[email protected]:xx/xx.git"
{{ end }}
- Use a
run_once_after_
script to checkout the repo on first run:
#!/bin/bash
# run_once_after_checkout-config-xx.sh
git clone [email protected]:xx/xx.git .config/xx
from chezmoi.
@bingo084 Try if not (has "init" .chezmoi.args)
from chezmoi.
Another alternative is to call apply
2 times:
$ chezmoi apply -k
$ chezmoi apply
From docs:
-k
,--keep-going
Keep going as far as possible after a encountering an error.
from chezmoi.
I would suggest the following:
- In your
.chezmoiexternal
file, exclude.config/xx
if you're runningchezmoi init
:# .chezmoiexternal.tompl {{ if not has "init" .chezmoi.args }} [".config/xx"] type = "git-repo" url = "[email protected]:xx/xx.git" {{ end }}
- Use a
run_once_after_
script to checkout the repo on first run:#!/bin/bash # run_once_after_checkout-config-xx.sh git clone [email protected]:xx/xx.git .config/xx
There seems to be a problem with the template syntax, after change accroding to above.
Run chezmoi update
:
chezmoi: /Users/bingo/.local/share/chezmoi/.chezmoiexternal.toml: template: /Users/bingo/.local/share/chezmoi/.chezmoiexternal.toml:9:6: executing "/Users/bingo/.local/share/chezmoi/.chezmoiexternal.toml" at <not>: wrong number of args for not: want 1 got 3
Directly execute template chezmoi execute-template < .chezmoiexternal.toml
chezmoi: template: stdin:9:6: executing "stdin" at <not>: wrong number of args for not: want 1 got 3
from chezmoi.
@bingo084 Try
if not (has "init" .chezmoi.args)
It works, thanks!
from chezmoi.
Related Issues (20)
- Powershell one-line install on Windows 11 error - "You cannot call a method on a null-valued expression" HOT 17
- One-line binary install script does not give an error when cannot establish HTTPS connection HOT 4
- `chezmoid apply` (and `dump`) cause a Go panic HOT 3
- Option for `.chezmoiexternal` to add files directly to target and not in source state HOT 3
- Option to include directories outside of Chezmoi's root HOT 1
- Add support for template prefix HOT 3
- Support `failure` hooks and scripts HOT 7
- `--follow` and `--recursive` add seem to conflict
- Extend re-add command to add new files
- .chezmoiignore thinks closing braces are a pattern HOT 3
- Trouble ignoring certain files
- `chezmoi edit-config-template` creates initial template with world-writable permissions HOT 2
- Using environment variable in onepasswordRead HOT 2
- Support chmod in attributes HOT 5
- Powershell one-line install on Windows 11 error - update script at https://get.chezmoi.io/ps1 HOT 1
- run time bug when `chezmoi doctor` invoked HOT 6
- Make accidental removal harder
- forced update says "Already up to date." HOT 1
- Ability to dry-run / diff scripts HOT 5
- Local repository. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chezmoi.