Skip to content

Commit

Permalink
Added ffmpeg/ffprobe permission correction code for linux/osx (#814)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeSmithStarkers authored Oct 3, 2020
1 parent 8866670 commit 30e88b9
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions pkg/ffmpeg/downloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,22 @@ func Download(configDirectory string) error {
if err := unzip(archivePath, configDirectory); err != nil {
return err
}

// On OSX or Linux set downloaded files permissions
if runtime.GOOS == "darwin" || runtime.GOOS == "linux" {
if err := os.Chmod(filepath.Join(configDirectory, "ffmpeg"), 0755); err != nil {
return err
}

if err := os.Chmod(filepath.Join(configDirectory, "ffprobe"), 0755); err != nil {
return err
}

// TODO: In future possible clear xattr to allow running on osx without user intervention
// TODO: this however may not be required.
// xattr -c /path/to/binary -- xattr.Remove(path, "com.apple.quarantine")
}

} else {
return fmt.Errorf("ffmpeg was downloaded to %s", archivePath)
}
Expand Down

0 comments on commit 30e88b9

Please sign in to comment.