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

[oh-my-zsh]$ZSH should be used to compose its install directory #426

Closed
SteveLauC opened this issue May 9, 2023 · 0 comments · Fixed by #434
Closed

[oh-my-zsh]$ZSH should be used to compose its install directory #426

SteveLauC opened this issue May 9, 2023 · 0 comments · Fixed by #434

Comments

@SteveLauC
Copy link
Member

When determining if oh-my-zsh is installed, we check the existence of its installation directory, and this directory can be customized through the $ZSH environment variable when installing, which means the directory is possibly not ~/.oh-my-zsh. However, in the current impl of topgrade, it is hardcoded to ~/.oh-my-zsh:

topgrade/src/steps/zsh.rs

Lines 156 to 157 in 14753a1

require("zsh")?;
let oh_my_zsh = HOME_DIR.join(".oh-my-zsh").require()?;

We should do something like this:

    let oh_my_bash = var("ZSH")
        // default to `~/.oh-my-zsh`
        .unwrap_or(
            HOME_DIR
                .join(".oh-my-zsh")
                .to_str()
                .expect("should be UTF-8 encoded")
                .to_string(),
        )
        .require()?;
@SteveLauC SteveLauC changed the title [oh-my-zsh]$ZSH should be used when composing its install directory [oh-my-zsh]$ZSH should be used to compose its install directory May 9, 2023
@s34m s34m closed this as completed in #434 May 22, 2023
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 a pull request may close this issue.

1 participant