knqyf263 / pet

Simple command-line snippet manager
MIT License
4.44k stars 223 forks source link

feature request: using zsh shell to execute the command #187

Closed royaso closed 1 year ago

royaso commented 2 years ago

In zsh I can use something like this print -C 5 $(<path/to/file) but when I get it to pet and the try to exec it, it fail

sh: print: command not found exit status 127

I think it is because the using of sh shell

and i search the repo for "sh")

cmd = exec.Command("sh", "-c", command)

so maybe another version for using zsh to execute commands? thanks

brumhard commented 2 years ago

Since this repo doesn't seem too active right now, here's another workaround pet search |bash or pet search |zsh -p also do that.

royaso commented 2 years ago

hi, I am using macos brew to install this command.

your RP seems to close this issue, I wannt to try, How should i do.

do I have to brew uninstall pet? then how can I install your modified version of pet?

brumhard commented 2 years ago

@royaso yes you have to first uninstall pet with brew, then check you my fork and run go install ./.... Sadly there's no other way to install my version with the changes. But please keep in mind that my fork won't be maintained as well so in case @knqyf263 starts getting active here remember to use this version again.

jolheiser commented 1 year ago

This is somewhat related to the feature requested, but I would expand it to make it per-snippet (using default if not specified)

I would love to sync pet across multiple OS, where some snippets may be powershell, some bash, some nushell, etc.