You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm writing a CLI which needs a config file in the $HOME directory.
I have no problems writing to a local config file "." however the file doesn't want to write in $HOME:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm writing a CLI which needs a config file in the $HOME directory.
I have no problems writing to a local config file
"."
however the file doesn't want to write in $HOME:This gives an expected error:
The path looks correct. So once we write the file, it should exist.
I've tried writing the file two different ways:
Results in error:
So it doesn't want to write to a file that doesn't yet exist.
Ive also tried:
Which results in error:
open $HOME/.config: no such file or directory
(Also tried a combination of both path and file name, error is the same:)
open $HOME/.config/config.toml: no such file or directory
If I set the path to
The file gets written, even though it doesn't exist initially.
What gives? How can I go about writing a config file in my $HOME?
Beta Was this translation helpful? Give feedback.
All reactions