IlanCosman / tide

🌊 The ultimate Fish prompt.
MIT License
2.93k stars 109 forks source link

fisher: Cannot install "ilancosman/tide": please remove or move conflicting files first #384

Closed CouldBeThis closed 1 year ago

CouldBeThis commented 1 year ago

Describe the bug

Install instructions are incomplete/incorrect. They fail if there is already a prompt file, which in my case seems to have been provided by default.

Steps to reproduce

  1. install fish (via pacman)
  2. install fisher (via pacman)
  3. attempt installing tide (via fisher)
$ fisher install IlanCosman/tide
fisher install version 4.4.3
Fetching https://api.github.com/repos/ilancosman/tide/tarball/HEAD
fisher: Cannot install "ilancosman/tide": please remove or move conflicting files first:
        /home/myusername/.config/fish/functions/fish_prompt.fish

Environment

fish version: 3.6.0
tide version: 5.5.1
term: xterm-kitty
os: Manjaro Linux 22.0.4 Sikaris
terminal emulator: kitty
fish startup: 44.56 millis
fisher plugins: franciscolourenco/done ilancosman/tide

Additional context

I just today decided to give fish a try so hopefully I am not missing anything. I do not know if there is any possibility to resolve this smoothly. But since fish is promoted as a beginner-friendly shell, I thought it might be worth mentioning in case it could be done.

Ideally the installer could either ask the user "do you want to move the file?" or simply go ahead and inform them of the filename.

Otherwise, install instructions should be something along the lines of the following:

mv ~/.config/fish/functions/fish_prompt.fish ~/.config/fish/functions/fish_prompt-original.fish
fisher install IlanCosman/tide

A datestamp in the new file name would be good to avoid duplicate files in case of multiple installs. Not sure how to do that in the concise and fishy way.

Searching the error in the fisher repo found jorgebucaran/fisher#624, "Plugin installation can clobber existing files"

CouldBeThis commented 1 year ago

I ran fisher update to see what would happen.

$ fisher update 
fisher update version 4.4.3
Fetching https://api.github.com/repos/franciscolourenco/done/tarball/HEAD
Fetching https://api.github.com/repos/ilancosman/tide/tarball/HEAD
Installing franciscolourenco/done
           /home/myusername/.config/fish/conf.d/done.fish
Installing ilancosman/tide
           /home/myusername/.config/fish/functions/_tide_1_line_prompt.fish
           /home/myusername/.config/fish/functions/_tide_2_line_prompt.fish
           /home/myusername/.config/fish/functions/_tide_cache_variables.fish
           /home/myusername/.config/fish/functions/_tide_detect_os.fish
           /home/myusername/.config/fish/functions/_tide_find_and_remove.fish
           /home/myusername/.config/fish/functions/_tide_item_aws.fish
           /home/myusername/.config/fish/functions/_tide_item_character.fish
           /home/myusername/.config/fish/functions/_tide_item_chruby.fish
           /home/myusername/.config/fish/functions/_tide_item_cmd_duration.fish
           /home/myusername/.config/fish/functions/_tide_item_context.fish
           /home/myusername/.config/fish/functions/_tide_item_crystal.fish
           /home/myusername/.config/fish/functions/_tide_item_distrobox.fish
           /home/myusername/.config/fish/functions/_tide_item_docker.fish
           /home/myusername/.config/fish/functions/_tide_item_git.fish
           /home/myusername/.config/fish/functions/_tide_item_go.fish
           /home/myusername/.config/fish/functions/_tide_item_java.fish
           /home/myusername/.config/fish/functions/_tide_item_jobs.fish
           /home/myusername/.config/fish/functions/_tide_item_kubectl.fish
           /home/myusername/.config/fish/functions/_tide_item_nix_shell.fish
           /home/myusername/.config/fish/functions/_tide_item_node.fish
           /home/myusername/.config/fish/functions/_tide_item_os.fish
           /home/myusername/.config/fish/functions/_tide_item_php.fish
           /home/myusername/.config/fish/functions/_tide_item_private_mode.fish
           /home/myusername/.config/fish/functions/_tide_item_pulumi.fish
           /home/myusername/.config/fish/functions/_tide_item_rustc.fish
           /home/myusername/.config/fish/functions/_tide_item_shlvl.fish
           /home/myusername/.config/fish/functions/_tide_item_status.fish
           /home/myusername/.config/fish/functions/_tide_item_terraform.fish
           /home/myusername/.config/fish/functions/_tide_item_time.fish
           /home/myusername/.config/fish/functions/_tide_item_toolbox.fish
           /home/myusername/.config/fish/functions/_tide_item_vi_mode.fish
           /home/myusername/.config/fish/functions/_tide_item_virtual_env.fish
           /home/myusername/.config/fish/functions/_tide_parent_dirs.fish
           /home/myusername/.config/fish/functions/_tide_print_item.fish
           /home/myusername/.config/fish/functions/_tide_pwd.fish
           /home/myusername/.config/fish/functions/_tide_remove_unusable_items.fish
           /home/myusername/.config/fish/functions/_tide_sub_bug-report.fish
           /home/myusername/.config/fish/functions/_tide_sub_configure.fish
           /home/myusername/.config/fish/functions/fish_mode_prompt.fish
           /home/myusername/.config/fish/functions/fish_prompt.fish
           /home/myusername/.config/fish/functions/tide
           /home/myusername/.config/fish/functions/tide.fish
           /home/myusername/.config/fish/conf.d/_tide_init.fish
           /home/myusername/.config/fish/completions/tide.fish
ilancosman/tide is a development branch. Please install from a release tag:
fisher install ilancosman/tide@v5
Updated 2 plugin/s

at the very end it suggests installing a different version so I tried that:

$ fisher install ilancosman/tide@v5
fisher install version 4.4.3
Fetching https://api.github.com/repos/ilancosman/tide/tarball/v5
fisher: Cannot install "ilancosman/tide@v5": please remove or move conflicting files first:
        /home/myusername/.config/fish/functions/_tide_1_line_prompt.fish
        /home/myusername/.config/fish/functions/_tide_2_line_prompt.fish
        /home/myusername/.config/fish/functions/_tide_cache_variables.fish
        /home/myusername/.config/fish/functions/_tide_detect_os.fish
        /home/myusername/.config/fish/functions/_tide_find_and_remove.fish
        /home/myusername/.config/fish/functions/_tide_item_aws.fish
        /home/myusername/.config/fish/functions/_tide_item_character.fish
        /home/myusername/.config/fish/functions/_tide_item_chruby.fish
        /home/myusername/.config/fish/functions/_tide_item_cmd_duration.fish
        /home/myusername/.config/fish/functions/_tide_item_context.fish
        /home/myusername/.config/fish/functions/_tide_item_crystal.fish
        /home/myusername/.config/fish/functions/_tide_item_docker.fish
        /home/myusername/.config/fish/functions/_tide_item_git.fish
        /home/myusername/.config/fish/functions/_tide_item_go.fish
        /home/myusername/.config/fish/functions/_tide_item_java.fish
        /home/myusername/.config/fish/functions/_tide_item_jobs.fish
        /home/myusername/.config/fish/functions/_tide_item_kubectl.fish
        /home/myusername/.config/fish/functions/_tide_item_nix_shell.fish
        /home/myusername/.config/fish/functions/_tide_item_node.fish
        /home/myusername/.config/fish/functions/_tide_item_os.fish
        /home/myusername/.config/fish/functions/_tide_item_php.fish
        /home/myusername/.config/fish/functions/_tide_item_private_mode.fish
        /home/myusername/.config/fish/functions/_tide_item_rustc.fish
        /home/myusername/.config/fish/functions/_tide_item_shlvl.fish
        /home/myusername/.config/fish/functions/_tide_item_status.fish
        /home/myusername/.config/fish/functions/_tide_item_terraform.fish
        /home/myusername/.config/fish/functions/_tide_item_time.fish
        /home/myusername/.config/fish/functions/_tide_item_toolbox.fish
        /home/myusername/.config/fish/functions/_tide_item_vi_mode.fish
        /home/myusername/.config/fish/functions/_tide_item_virtual_env.fish
        /home/myusername/.config/fish/functions/_tide_parent_dirs.fish
        /home/myusername/.config/fish/functions/_tide_print_item.fish
        /home/myusername/.config/fish/functions/_tide_pwd.fish
        /home/myusername/.config/fish/functions/_tide_remove_unusable_items.fish
        /home/myusername/.config/fish/functions/_tide_sub_bug-report.fish
        /home/myusername/.config/fish/functions/_tide_sub_configure.fish
        /home/myusername/.config/fish/functions/fish_mode_prompt.fish
        /home/myusername/.config/fish/functions/fish_prompt.fish
        /home/myusername/.config/fish/functions/tide
        /home/myusername/.config/fish/functions/tide.fish
        /home/myusername/.config/fish/conf.d/_tide_init.fish
        /home/myusername/.config/fish/completions/tide.fish

does this happen anytime there is an upgrade? If so I am not sure if it is an issue with this project or fisher. Like I said I am new to all of it.

jorgebucaran commented 1 year ago

I think the issue is that Fisher can't tell that you are trying to install a different version of Tide. In this particular case, we could overwrite the previous Tide since that's your intent anyway. Otherwise, we basically added this feature to prevent people overwriting any custom fish_prompt in their ~/.config/fish/functions inadvertently.

To solve this, remove Tide and install Tide@v5.

lef-fan commented 1 year ago

I can confirm, I had to rename existing fish_prompt.fish before proceed.