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

fixes iawia002/lux#1121 #1129

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 11 additions & 1 deletion main.go
Expand Up @@ -7,15 +7,25 @@ import (
"github.com/fatih/color"

"github.com/iawia002/lux/app"
"github.com/iawia002/lux/utils"
)

func main() {
errFFMPEG := utils.IsFfmpegInstalled()
if errFFMPEG != nil {
Sfrisio marked this conversation as resolved.
Show resolved Hide resolved
fmt.Fprintf(
color.Output,
"Dependency not found: %s\n",
color.RedString("%s", errFFMPEG),
)
os.Exit(1)
}
if err := app.New().Run(os.Args); err != nil {
fmt.Fprintf(
color.Output,
"Run %s failed: %s\n",
color.CyanString("%s", app.Name), color.RedString("%v", err),
)
os.Exit(1)
os.Exit(2)
}
}
8 changes: 8 additions & 0 deletions utils/ffmpeg.go
Expand Up @@ -9,6 +9,14 @@ import (
"github.com/pkg/errors"
)

func IsFfmpegInstalled() error {
Sfrisio marked this conversation as resolved.
Show resolved Hide resolved
_, err := exec.LookPath("ffmpeg")
if err != nil {
return errors.Errorf("%s", err)
}
return nil
}

func runMergeCmd(cmd *exec.Cmd, paths []string, mergeFilePath string) error {
var stderr bytes.Buffer
cmd.Stderr = &stderr
Expand Down