-
Notifications
You must be signed in to change notification settings - Fork 493
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chezmoi cd
and chezmoi doctor
doesn't honour chezmoi init --source /path
when initialising
#3647
Comments
You can use file |
Yes, the config file works. But that would void |
I don't think that this is a bug, because If you do not have If you add $ chezmoi execute-template --init --source /foo '{{ .chezmoi.config.sourceDir }}'
/foo |
It's quite surprising to me to have to do this - I would expect that just setting |
Ah, there is indeed mention of it at: https://www.chezmoi.io/user-guide/setup/#create-a-config-file-on-a-new-machine-automatically It is still surprising that a minimal customised setup isn't possible without the config file template, and just by setting ¯_(ツ)_/¯ |
I’m changing this to an enhancement request. I think that it’s a reasonable default if there is no |
Flags like chezmoi is opinionated software (i.e. it provides sensible defaults) and follows the XDG specification (i.e. it stores its user-specific data files in Note also that chezmoi makes a clear distinction between config (which is only written by the user and is only read by chezmoi) and state (which is and only read and written by chezmoi and can be deleted at any time). If chezmoi were to implement:
then chezmoi would have to store the user's source directory somewhere. It can't store it in the config (as that is only written by the user) and it can't store it in the state (as that can be deleted at any time). The compromise is that, if you want to use a different source directory to
I think that is a reasonable compromise. |
As a newbie to chezmoi and an old hat to open source, I appreciate the terse and prompt response! I assumed that as
That makes sense. Wouldn't environment variables be a great use case for this?
Even when setting Environment variables circumvent the config+state issue, just as long as No worries to create a config file template, but as an enhancement it would be great to define or make known to the user of the implicit and/or explicit dependency/blocker that running |
Maybe this needs a separate issue, but I would currently classify this as a bug because the script generated by |
Describe the bug
As a first time chezmoi user
I want to be able to set the source path when initialising
So that when I run
chezmoi cd
andchezmoi doctor
I can see that my source-dir is set to the path atinit
timeTo reproduce
Expected behavior
When manually creating a
chezmoi.yaml
config file, I am able to set the source dir manually and it works when running bothcd
anddoctor
commands.What I expect to happen is that this is dealt with from the
init
command when setting the source. My goal is to streamline the setup process, hopefully in absence of a config zero file (as that will come later), rather than the creation of the config file as pre-req.Output of command with the
--verbose
flagOutput of
chezmoi doctor
The text was updated successfully, but these errors were encountered: