Skip to content
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

~ tilde is not suppored in a global config #996

Open
thebino opened this issue Jan 5, 2024 · 3 comments
Open

~ tilde is not suppored in a global config #996

thebino opened this issue Jan 5, 2024 · 3 comments
Labels
A-config Area: Related to the config file functionality and format A-core Area: Generally related to `rustic_core` A-filesystem Area: Related to the Filesystem in one way or the other A-ui-ux Area: Related to user interfaces and user experience C-enhancement Category: New feature or request

Comments

@thebino
Copy link

thebino commented Jan 5, 2024

If I want to use ~ in any path in the global config, it will not parse the config and stop with a non-helpful error.

For example if I want to write a logfile to the local .config directory

log-file = "~/.config/rustic/rustic.log"

Same for sources

[[backup.sources]]
source = "~/foo"

On mac the error message is also kind of strange (without showing which config is used)

error: rustic-rs fatal error: I/O operation failed: No such file or directory (os error 2)
@github-actions github-actions bot added the S-triage Status: Waiting for a maintainer to triage this issue/PR label Jan 5, 2024
@simonsan simonsan added C-bug Category: Something isn't working as expected A-core Area: Generally related to `rustic_core` A-ui-ux Area: Related to user interfaces and user experience A-config Area: Related to the config file functionality and format and removed S-triage Status: Waiting for a maintainer to triage this issue/PR labels Jan 6, 2024
@aawsome aawsome added C-enhancement Category: New feature or request and removed C-bug Category: Something isn't working as expected labels Jan 11, 2024
@aawsome
Copy link
Member

aawsome commented Jan 11, 2024

As ~ is IMO just a special case of variable substitution (here the env variable $HOME), I'm closing this as duplicate of #942

@aawsome aawsome closed this as completed Jan 11, 2024
@simonsan
Copy link
Contributor

simonsan commented Feb 9, 2024

Discovered this library lately: https://docs.rs/crate/shellexpand/3.1.0

Maybe worth another discussion, if we can implement it with that more easily?

Reopening for that discussion

@simonsan simonsan reopened this Feb 9, 2024
@simonsan
Copy link
Contributor

simonsan commented Feb 9, 2024

Copying over the discussion points of env var expansion:

This feature is a bit more involved as there are more questions arising:

  • Do we only want variable substitution in filenames or elsewhere in the config?
  • Do we want to allow substition only within strings?
  • Do we want to first parse the TOML, then substitute what is appropriate or first substitute and then parse (which would allow to define TOML structures within env variables)?

Originally posted by @aawsome in #942 (comment)

@simonsan simonsan added the A-filesystem Area: Related to the Filesystem in one way or the other label Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-config Area: Related to the config file functionality and format A-core Area: Generally related to `rustic_core` A-filesystem Area: Related to the Filesystem in one way or the other A-ui-ux Area: Related to user interfaces and user experience C-enhancement Category: New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants