-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
56 lines (43 loc) · 959 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package main
import (
"fmt"
"log"
"os"
"github.com/mitoteam/mtconvy/app"
"github.com/mitoteam/mttools"
)
func main() {
var current_path string
//Read path from args if available
if len(os.Args) > 1 {
if os.Args[1] == "version" {
fmt.Println(app.BuildVersion)
os.Exit(0)
}
current_path = os.Args[1]
} else {
var err error
current_path, err = os.Getwd()
if err != nil {
log.Fatal(err)
}
}
fmt.Printf("mtconvy v%s - ffmpeg helper utility by MiTo Team. https://mito-team.com\n\n", app.BuildVersion)
if !mttools.IsDirExists(current_path) {
log.Fatalf("Directory %s does not exist", current_path)
os.Exit(-1)
}
//Deal with settings
app.AppSettings.Load(current_path)
app.AppSettings.Print()
if !app.AppSettings.Check() {
os.Exit(-1)
return
}
//Create task
log.Printf("Current directory: %s", current_path)
task := app.NewTask(current_path)
task.SelectFiles()
task.SelectStreams()
task.Convert()
}