r-darwish / topgrade

Upgrade everything
GNU General Public License v3.0
3.35k stars 160 forks source link

oh-my-zsh update broken #379

Closed KizzyCode closed 4 years ago

KizzyCode commented 4 years ago

What did you expect to happen? Topgrade updates oh-my-zsh

What actually happened? The update fails since 19/20 Mar 2020 (I'm not sure)

Additional details:

Idea: Maybe this is because the repo URL changed to https://github.com/ohmyzsh/ohmyzsh? However if I use the built-in update mechanism (running upgrade_oh_my_zsh from inside $HOME/.oh-my-zsh/), it works flawlessly.

Output of topgrade --verbose --only shell

 2020-03-21T14:39:42.512Z DEBUG topgrade::config > Configuration at /Users/keziah/.config/topgrade.toml
 2020-03-21T14:39:42.512Z DEBUG topgrade::config > Loaded configuration: ConfigFile { pre_commands: None, commands: None, git_repos: None, predefined_git_repos: None, disable: None, remote_topgrades: None, ssh_arguments: None, git_arguments: None, tmux_arguments: None, set_title: None, assume_yes: None, yay_arguments: None, no_retry: None, run_in_tmux: None, cleanup: None, notify_each_step: None, accept_all_windows_updates: None, only: None, composer: None }
 2020-03-21T14:39:42.512Z DEBUG topgrade         > Version: 4.3.0
 2020-03-21T14:39:42.512Z DEBUG topgrade         > OS: x86_64-apple-darwin
 2020-03-21T14:39:42.512Z DEBUG topgrade         > Args { inner: ["topgrade", "--verbose", "--only", "shell"] }
 2020-03-21T14:39:42.512Z DEBUG topgrade         > Binary path: Ok("/usr/local/bin/topgrade")
 2020-03-21T14:39:42.512Z DEBUG topgrade         > Self Update: false
 2020-03-21T14:39:42.513Z DEBUG topgrade::utils  > Detected "/usr/bin/git" as "git"
 2020-03-21T14:39:42.513Z DEBUG topgrade::utils  > Detected "/usr/bin/sudo" as "sudo"
 2020-03-21T14:39:42.514Z DEBUG topgrade::utils  > Cannot find "pwsh"
 2020-03-21T14:39:42.514Z DEBUG topgrade::utils  > Cannot find "powershell"
 2020-03-21T14:39:42.514Z DEBUG topgrade::steps::git > /Users/keziah/.zshrc is a file. Checking /Users/keziah
 2020-03-21T14:39:42.514Z DEBUG topgrade::steps::git > Checking if /Users/keziah is a git repository
 2020-03-21T14:39:42.530Z TRACE topgrade::executor   > Output of "/usr/bin/git" "rev-parse" "--show-toplevel": Output { status: ExitStatus(ExitStatus(32768)), stdout: "", stderr: "fatal: not a git repository (or any of the parent directories): .git\n" }
 2020-03-21T14:39:42.530Z DEBUG topgrade::steps::git > /Users/keziah/.tmux does not exists
 2020-03-21T14:39:42.530Z DEBUG topgrade::steps::git > /Users/keziah/.config/fish does not exists
 2020-03-21T14:39:42.530Z DEBUG topgrade::steps::git > /Users/keziah/Library/Preferences/openbox does not exists
 2020-03-21T14:39:42.530Z DEBUG topgrade::steps::git > /Users/keziah/Library/Preferences/bspwm does not exists
 2020-03-21T14:39:42.530Z DEBUG topgrade::steps::git > /Users/keziah/Library/Preferences/i3 does not exists
 2020-03-21T14:39:42.530Z DEBUG topgrade::steps::git > /Users/keziah/Library/Preferences/sway does not exists
 2020-03-21T14:39:42.530Z DEBUG topgrade::runner     > Step "zr"
 2020-03-21T14:39:42.530Z DEBUG topgrade::utils      > Detected "/usr/local/bin/zsh" as "zsh"
 2020-03-21T14:39:42.531Z DEBUG topgrade::utils      > Path "/Users/keziah/.zr" doesn't exist
 2020-03-21T14:39:42.531Z DEBUG topgrade::runner     > Step "antibody"
 2020-03-21T14:39:42.531Z DEBUG topgrade::utils      > Detected "/usr/local/bin/zsh" as "zsh"
 2020-03-21T14:39:42.531Z DEBUG topgrade::utils      > Cannot find "antibody"
 2020-03-21T14:39:42.531Z DEBUG topgrade::runner     > Step "antigen"
 2020-03-21T14:39:42.531Z DEBUG topgrade::utils      > Detected "/usr/local/bin/zsh" as "zsh"
 2020-03-21T14:39:42.531Z DEBUG topgrade::utils      > Path "/Users/keziah/.zshrc" exists
 2020-03-21T14:39:42.531Z DEBUG topgrade::utils      > Path "/Users/keziah/antigen.zsh" doesn't exist
 2020-03-21T14:39:42.531Z DEBUG topgrade::runner     > Step "zplug"
 2020-03-21T14:39:42.531Z DEBUG topgrade::utils      > Detected "/usr/local/bin/zsh" as "zsh"
 2020-03-21T14:39:42.531Z DEBUG topgrade::utils      > Path "/Users/keziah/.zshrc" exists
 2020-03-21T14:39:42.531Z DEBUG topgrade::utils      > Path "/Users/keziah/zplug" doesn't exist
 2020-03-21T14:39:42.531Z DEBUG topgrade::runner     > Step "zinit"
 2020-03-21T14:39:42.531Z DEBUG topgrade::utils      > Detected "/usr/local/bin/zsh" as "zsh"
 2020-03-21T14:39:42.531Z DEBUG topgrade::utils      > Path "/Users/keziah/.zshrc" exists
 2020-03-21T14:39:42.531Z DEBUG topgrade::utils      > Path "/Users/keziah/.zinit" doesn't exist
 2020-03-21T14:39:42.531Z DEBUG topgrade::runner     > Step "oh-my-zsh"
 2020-03-21T14:39:42.532Z DEBUG topgrade::utils      > Detected "/usr/local/bin/zsh" as "zsh"
 2020-03-21T14:39:42.532Z DEBUG topgrade::utils      > Path "/Users/keziah/.oh-my-zsh" exists

―― 15:39:42 - oh-my-zsh ――――――――――――――――――――――――――――――――――――――――――――――――――――――――
 2020-03-21T14:39:42.822Z TRACE topgrade::executor   > Output of "zsh" "-i" "-c" "echo -n $ZSH_CUSTOM": Output { status: ExitStatus(ExitStatus(0)), stdout: "\u{1b}]7;file://Kizzys-MBA.local/Users/keziah\u{7}/Users/keziah/.oh-my-zsh/custom", stderr: "" }
 2020-03-21T14:39:42.823Z DEBUG topgrade::steps::zsh > oh-my-zsh custom dir: /Users/keziah/.oh-my-zsh/custom/plugins
 2020-03-21T14:39:42.823Z DEBUG topgrade::terminal   > Desktop notification: oh-my-zsh failed

Retry? (y)es/(N)o/(s)hell

And thank you for topgrade; it is awesome!!

r-darwish commented 4 years ago

It happens to me as well. I'll look for a solution.

sierisimo commented 4 years ago

Only thing I have found is that it fails when trying to read the custom plugins directory of zsh.

I added a debug! call in file: zsh.rs at line ~101

To move this:

for entry in fs::read_dir(custom_dir)? {

to this:

let read_dir = fs::read_dir(custom_dir);
debug!(">> {:?}", read_dir);
for entry in read_dir? {

and found this Err:

Err(Os { code: 2, kind: NotFound, message: "No such file or directory" })

which is weird to me as ~/.oh-my-zsh/custom/plugins actually exists.

r-darwish commented 4 years ago

Thanks @sierisimo. This should be fixed in v4.3.1