Git Product home page Git Product logo

Comments (7)

FredDeschenes avatar FredDeschenes commented on August 15, 2024

Yeah I'm trying to get this working on fish too. I'm afraid it won't work :(

Since all the prm scripts are ran from bash, as soon as this exits and you're back in fish, all the cd-ing and whatnot you did won't matter, as it was in a different shell.

I might port this to fish someday, but it'll have to be a different implementation with fish functions (unless someone as a better idea, I'm far from being an expert at fish scripting).

EDIT: Fyi 'sourcing' the prm script inside fish won't work as it's written for bash.

from prm.

omnidan avatar omnidan commented on August 15, 2024

@FredDeschenes alright, keep me updated here if you ever develop a fish port :)

from prm.

EivindArvesen avatar EivindArvesen commented on August 15, 2024

@FredDeschenes is completely right.

As I don't have much experience with fish, I don't know the details of the compatibility-issues between it and bash.

However (and I'm just spitballing here):
Wouldn't making the hashbang directives (in prm as well as the generated scripts) more ambiguous (i.e. sh instead of bash) and/or removing it from prm entirely if fish is not bourne-compatible, and changing the case in @omnidan's original comment to if-tests make the script fish-compatible?

from prm.

FredDeschenes avatar FredDeschenes commented on August 15, 2024

@eivind88 Well compatibility-wise, fish just cannot source bash scripts, their scripts being so different.
You can make prm run in fish by adding a 'prm' function

function prm
    bash /path/to/prm $argv
end

but this runs the script in a different shell, so it's basically a noop.

Also, since the scripts are sourced inside bash, they have to be bash scripts themselves, so we can't use any fish functionality with them.

EDIT : To get an idea of how different they are.

from prm.

EivindArvesen avatar EivindArvesen commented on August 15, 2024

I was thinking more in the vein of (something like) fish prm.sh and not explicitly sourcing other scripts in bash (i.e. leaving it ambiguous so that whatever shell is used is tried), but I've since discovered that there are some major differences in syntax that make them incompatible.

So it indeed appears that prm won't work with fish shell unless it is explicitly ported.

from prm.

FredDeschenes avatar FredDeschenes commented on August 15, 2024

Shameless plug, but I've mostly ported prm for fish here.

Report any issues you might have (or create pull requests for the couple of missing features :P)!

from prm.

EivindArvesen avatar EivindArvesen commented on August 15, 2024

Great job!
I'll add a link to your port in the prm readme.

from prm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.