jorgebucaran / fisher

A plugin manager for Fish
https://git.io/fisher
MIT License
7.55k stars 257 forks source link

Installation fails from bash #639

Closed mnieber closed 3 years ago

mnieber commented 3 years ago

Hi,

since piping to source is not possible the installation fails with

> curl -sL https://git.io/fisher | source && fisher install jorgebucaran/fisher
bash: source: filename argument required
source: usage: source filename [arguments]

Also, it would be good to document whether the installation should be run from bash, sh or fish (since it has a && it won't work in fish, but that won't be obvious to everybody).

I will instead try adding the fisher functions to fish manually. In any case, thanks for creating the tool, I think it will come in very handy.

Best, Maarten

jorgebucaran commented 3 years ago

The installation should be run from Fish. Actually, Fish supports && since 3.0.

mnieber commented 3 years ago

Okay, I see. I'm on fish 2.7.1 (from the ubuntu repository). I would like to publish a fish config that should be usable to other people who are on older fish functions, so I will try fundle.

mnieber commented 3 years ago

ps I now realize that there is a standard plugin format, so it doesn't matter which tool is used to install them. Anyway, I'm new to this topic :-)

jorgebucaran commented 3 years ago

@mnieber Fish alone can go a long way. I recommend not even using a plugin manager if you're new to Fish. There's no standard plugin format either. I also don't recommend using Fundle either, as it's been inactive for more than two years, supports no install, update, remove events, and can potentially make your shell slow (as it requires you to run fundle in your config.fish).

I would like to publish a fish config that should be usable to other people who are on older fish functions.

There's really no reason to be stuck in Fish 2.7, so I suggest upgrading to Fish 3.0.

igalic commented 3 years ago

fish has an official package repository for ubuntu (PPA) with newer fish versions https://launchpad.net/~fish-shell/+archive/ubuntu/release-3/+packages

mnieber commented 3 years ago

Thanks, I checked it out! For some reason there seems to be a problem with this package for Linux Mint (that's the distribution I'm actually using, though it's based on Ubuntu). I will revisit this topic in case I ever run into trouble with having an older fish function.

jorgebucaran commented 3 years ago

@mnieber I'm curious, why are you using Fish if you can't upgrade to at least Fish 3.0? It just seems unusually odd. And why were you trying to install Fisher in the first place? What plugins were you interested in?

mnieber commented 3 years ago

I was coming from bash, so fish 2.7 was a huge improvement.

I have an open source tool called "dodo commands" that let's you create per-project development environments. For example, given this configuration (which is environment specific)

DIAL:
  shift:
    '1': ${/ROOT/src_dir}
    '2': ${/ROOT/src_dir}/frontend
    '3': ${/ROOT/src_dir}/backend

you can use SHIFT + F1/F2/F3 to quickly switch to these directories. This requires certain fish key bindings and fish functions, that are packaged with my tool. I want to make it easier for users to install these bindings (i.e. using a fish package manager)

jorgebucaran commented 3 years ago

That sounds like a great use case for Fisher, a modern, actively maintained plugin manager already widespread across the Fish community.

mnieber commented 3 years ago

I think that there is indeed some overlap, since both tools extend the shell environment with additional tools and commands. I do see an advantage in not having fish as an absolute requirement (dodo only requires Python). The preset directories are a nice time saver. but I'm especially happy with the layering system in dodo. For example, you can run dodo frontend.serve or dodo backend.serve and these "aliases" expand differently depending on the layer. You can see layers as environments within environments :-). The DIAL option lets you program the F2 key to insert the words dodo frontend. into the shell, this gives a very nice workflow (F2 to run a command on the frontend layer, and SHIFT+F2 to switch to the frontend directory).

mnieber commented 3 years ago

ps regarding the original question, I think I will include instructions for all 3 package managers (omf, fisher and fundle) on how to install the dodo bindings. I noticed though that omf does not allow you to install from a local directory, that's a pity (I would like to keep the fish functions bundled inside my dodo tool instead of having them in a separate repo).

jorgebucaran commented 3 years ago

Feel free to request a code review from me! Otherwise keep in mind: no top level fish files (Fisher is an exception due to historical reasons), prefix _foobar_ your functions, put them in functions/, one .fish file per function, autorun snippets in conf.d, and no non-standard inventions: no init.fish, or uninstall.fish.

mnieber commented 3 years ago

Okay, thanks, will do!

ismay commented 2 years ago

I still think it's a good idea to show a way to run the installation from bash (or zsh), as a lot of system bootstrapping happens in those shells. I don't know of any distro where fish is the default shell. What I'm using for setting up a fresh system with fisher in an automated setup script that runs bash (but has fish installed):

/usr/bin/fish -c "curl -sL https://git.io/fisher | source && fisher install jorgebucaran/fisher"

Let me know if there's a better way to do it. I'd have been helped with this being in the readme, others might appreciate it as well.