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

[Bug]: mpv command not found in gitbash #10221

Closed
3 tasks done
DanSM-5 opened this issue Jan 11, 2023 · 3 comments
Closed
3 tasks done

[Bug]: mpv command not found in gitbash #10221

DanSM-5 opened this issue Jan 11, 2023 · 3 comments
Labels

Comments

@DanSM-5
Copy link

DanSM-5 commented Jan 11, 2023

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all issues/PRs to ensure it has not already been reported or fixed.
  • I have verified that I am using the latest version of Scoop and corresponding bucket.

Package Name

mpv

Expected/Current Behaviour

I noticed that on the latest version of mpv 0.35.0 the mpv command stop working under gitbash.

This was confusing because the exact same version was installed on another PC and the command is working in gitbash without workarounds (alias or script file to map mpv.com). The cause for this issue was the change from shimming to use the path to mpv.

#9662

From the PR I see that's something related to mpv.net which I'm not very familiar with. Is this change required for the simple mpv? Because without the shim gitbash won't recognize mpv.

There are workarounds as I've mentioned before like aliasing mpv to mpv.com or simply creating a shell scrip to map to mpv.com but I'd like to know if this change if required for mpv in the first place.

Steps to Reproduce

  1. On latest version of scoop install mpv
scoop install mpv

  1. Open a bash shell (gitbash) and type mpv.
  2. Observe that the mpv command is not recognized as a valid command.

You can verify that previous version using the shim does work by installing mpv using the previous manifest.

  1. Install mpv with manifest that creates a shim (one commit before the change).
scoop install https://raw.githubusercontent.com/ScoopInstaller/Extras/a7f6726ad34dd8abca908c1882d1e150f0662477/bucket/mpv.json
  1. Open a bash shell (gitbash)
  2. Use mpv command and observe the output that it recognizes mpv.

Possible Solution

  • Revert the changes in mpv.json to use a shim file again instead of adding mpv to the path.
  • Do nothing and recommend alternatives like the ones mentioned in the steps to reproduce.

Scoop and Buckets Version

** Will update once I have the affected computer back **

Scoop Config

** Will update once I have the affected computer back **

PowerShell Version

** Will update once I have the affected computer back **

Additional Softwares

Git bash for Windows
Windows Terminal

@DanSM-5 DanSM-5 added the bug label Jan 11, 2023
@HUMORCE
Copy link
Member

HUMORCE commented Jan 11, 2023

$ mpv
bash: mpv: command not found

$ mpv.exe
mpv 0.35.0 Copyright © 2000-2022 mpv/MPlayer/mplayer2 projects
 built on Mon Nov 14 04:47:57 2022
...

@HUMORCE HUMORCE closed this as completed Jan 11, 2023
@DanSM-5
Copy link
Author

DanSM-5 commented Jan 12, 2023

Using the binary with extension works (in my case I need to use mpv.com instead of mpv.exe or it will just open the player ui instead of outputing information), I know and that solution is fine for simple use cases but it doesn't work when mpv is expected on scripts.

The reason I found this issue is because it stopped working on ani-cli and I found an issue opened regarding that pystardust/ani-cli#959.

That's why I wanted to ask if the change made to use a path instead of a shim is required for mpv as the PR that makes the change stated that the issue is for mpv.net.

In any case if this change is going to stay, I'd like to add a better solution for anyone finding this issue.

  1. Create a file in directory that it is in your path (E.g. $HOME/.local/bin) and named it mpv.sh.
  2. Open it with a text editor and add the following lines
#!/usr/bin/env bash
mpv.com "$@"
  1. Add executable permissions to the file. E.g.
chmod +x "$HOME/.local/bin/mpv.sh"

That should map the binary (mpv.com in my case) to a script that gitbash can find. That way there is no need to add the extension and modify scripts of binaries that expect mpv (without extensions).

@HUMORCE
Copy link
Member

HUMORCE commented Jan 12, 2023

That's why I wanted to ask if the change made to use a path instead of a shim is required for mpv as the PR that makes the change stated that the issue is for mpv.net.

the current situation is more in line with expectations either itself or Windows, IMO.

You can also do it with scoop-shim(scoop help shim).

scoop shim add mpv 'C:\Users\humorce\scoop\apps\mpv\current\mpv.com'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants