Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Sfrisio committed Jul 26, 2022
1 parent 33a669f commit 909a76b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
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 {
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 {
_, 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

0 comments on commit 909a76b

Please sign in to comment.