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

Feature request: option to force overwrite existing files #770

Open
edouard-lopez opened this issue Aug 2, 2023 · 8 comments
Open

Feature request: option to force overwrite existing files #770

edouard-lopez opened this issue Aug 2, 2023 · 8 comments

Comments

@edouard-lopez
Copy link
Contributor

Hello @jorgebucaran,
long time no see!

I'm working to add k8s support in Fish, when I try to install pure from my local directory, I'm met with a bunch of warning:

❯ fisher install ./                                                                                      
fisher install version 4.4.3                                                                             
fisher: Cannot install "/home/edouard/projects/contributions/pure": please remove or move conflicting files first:
        /home/edouard/.config/fish/functions/_pure_check_for_new_release.fish                            
        /home/edouard/.config/fish/functions/_pure_detect_container_by_cgroup_method.fish                                                                                                                          
        /home/edouard/.config/fish/functions/_pure_detect_container_by_pid_method.fish                   
        /home/edouard/.config/fish/functions/_pure_format_time.fish                                      
        /home/edouard/.config/fish/functions/_pure_get_prompt_symbol.fish         

and

❯ fisher install ./
fisher install version 4.4.3
fisher: Cannot install "/home/edouard/projects/contributions/pure": please remove or move conflicting files first:
        /home/edouard/.config/fish/functions/fish_greeting.fish
        /home/edouard/.config/fish/functions/fish_mode_prompt.fish
        /home/edouard/.config/fish/functions/fish_prompt.fish
        /home/edouard/.config/fish/functions/fish_title.fish

Actual

The current solution is to run:

  1. my uninstall script _pure_uninstall
  2. then remove rm $__fish_config_dir/functions/fish_*.fish
  3. finally install with fisher install ./

Expected

fisher install --force ./
@jorgebucaran
Copy link
Owner

Hey @edouard-lopez, that warning pops up when you're trying to install a plugin that might overwrite files from another one, which isn't what you want. I tried to reproduce your situation by creating a local plugin, installing it, and then trying to reinstall it a couple of different ways, but I couldn't get the same issue. So, while it might be a bug, it seems like something else might be going on in your case. Did you maybe do something out of the ordinary, like messing with Fisher's universal variable state?

Let me take a look at your repo. Where is it?

Why do you need to run Pure's uninstaller for anything related to k8s support in Fish? Are you trying to add k8s support to Pure or Fish?

@edouard-lopez
Copy link
Contributor Author

When developing a new feature, I'm regularly reinstalling the plugin using my local directory to check for the results. Yep, I'm working on displaying k8s contextual information see pure-fish/pure#322

@jorgebucaran
Copy link
Owner

Sure, I also do that with plugins I develop and it shouldn't cause any issues. Therefore, your problem must be originating from somewhere else. My hunch is that it could be related to you perhaps (inadvertently?) messing with Fisher's state variables. This issue might disappear if you uninstall everything, clean up your universal variables, and then reinstall.

Can you share the repository link? I'd like to take a closer look and try to reproduce your issue, as I was unable to do so based just on your description.

@edouard-lopez
Copy link
Contributor Author

Repo is here https://github.com/pure-fish/pure/

@edouard-lopez
Copy link
Contributor Author

I circumvented the issue by improving my docker workflow.

To build a Fish 3.6.1 with a working pure

❯ make build-pure-on dev-pure-on FISH_VERSION=3.6.1

To run test against Fish 3.6.1 and working files

❯ make -s dev-pure-on FISH_VERSION=3.6.1 CMD='fishtape tests/_pure_prompt_k8s.test.fish'

@fruffy
Copy link

fruffy commented Dec 15, 2024

I am also running into this problem when using dotfiles. The reason is that the dotfiles are slightly out of date and force overrwriting would fix it.

Fixing it requires uninstalling everything and manually reinstalling, which is a little tedious. A force flag could be very useful.

@lengyijun
Copy link

lengyijun commented Dec 31, 2024

We need fisher install --force and fisher update --force absolutely

@jorgebucaran jorgebucaran reopened this Dec 31, 2024
@jorgebucaran
Copy link
Owner

Understood. I'll look into how we could implement that.

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

No branches or pull requests

4 participants