Repository navigation
fix(ffmpeg): windows ffmpeg detection - #6
Conversation
- Add nix flake for development (thank me later nix devs) - Fix Windows ffmpeg detection: probe next to executable with .exe suffix instead of relying solely on PATH - Ran `go mod tidy`
|
@chikof is attempting to deploy a commit to the Aakash Pahuja's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
LGTM!!!! |
|
Thanks @chikof — nice work on the Windows detection fix 🙌 Tested locally: build is clean and existing tests still pass. A few things I'd like to see before merging, plus some smaller suggestions. Must-address1. Windows branch short-circuits all other fallbacks if runtime.GOOS == "windows" {
return findNextToExecutable(name, ".exe")
}This returns immediately on Windows whether the lookup succeeds or fails, so if runtime.GOOS == "windows" {
if p, err := findNextToExecutable(name, ".exe"); err == nil {
return p, nil
}
}That way we can add Windows-specific fallbacks (chocolatey, winget, 2. Regression: func fileExists(path string) bool {
info, err := os.Stat(path)
return err == nil && info.Mode().IsRegular()
}…and ideally keep 3. Error loses context Suggestions
Nix flakeHappy to have a dev flake, but a couple of things:
Nits
|
The nix flake has no impact on the project itself; it is intended solely for development purposes. Therefore, if another Nix developer notices, for example, that the Go version has changed, they can update it in the nix flake and that's it. |
go mod tidyThis PR fixes #1
It seems that Go behaves strangely on Windows. To get it to find the binary file in the directory where
nano-ffmpegis run, you have to explicitly tell it to search the current directory:exec.LookPath("./ffmpeg"). This was the only way I could get it to work without having to make any modifications, which isn't the right way to do it.