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

fix(dotfiles): unquote aliases before quoting #1976

Merged
merged 2 commits into from
Apr 23, 2024
Merged

Conversation

ellie
Copy link
Member

@ellie ellie commented Apr 23, 2024

We want to quote all aliases when setting config. Aliases in the store may be quoted, but may also be unquoted.

First normalise to unquoted, then quote.

Checks

  • I am happy for maintainers to push small adjustments to this PR, to speed up the review cycle
  • I have checked that there are no existing pull requests for the same thing

@ellie ellie merged commit bf88b42 into main Apr 23, 2024
17 checks passed
@ellie ellie deleted the ellie/ffs-fish-why branch April 23, 2024 13:45
@tessus
Copy link
Contributor

tessus commented Apr 23, 2024

May I ask what happens with aliases like these:

alias wd='echo "`whoami`@`hostname -s`:`pwd`"'
alias cdate='if [ -n "${TZ+x}" ]; then   export SAVETZ=$TZ;   export TZ=${CLIENT_TZ};   date ;   export TZ=$SAVETZ;   unset SAVETZ; else   export TZ=${CLIENT_TZ};   date;   unset TZ ; fi'
alias dt='date +"%Y-%m-%d %H:%M:%S %z"'

@ellie
Copy link
Member Author

ellie commented Apr 23, 2024

They all work without issue!

At least setting from the CLI. I'll double check importing.

@ellie
Copy link
Member Author

ellie commented Apr 23, 2024

Yep all good for imports too

@tessus
Copy link
Contributor

tessus commented Apr 23, 2024

perfect. thanks for the info. looking at the code alone, I wasn't sure how quotes in the middle of the alias are handled.

P.S.: I had the chance to lookup string manipulation in Rust and I get the code now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants