-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
41 lines (34 loc) · 1.03 KB
/
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
package main
import (
"flag"
"fmt"
"log"
"packmule/config"
"packmule/data"
)
func main() {
exportToYaml := flag.Bool("e", false, "Create Sample Yaml")
testYaml := flag.Bool("t", false, "Test Yaml File")
copyToDirectory := flag.Bool("c",false,"Copy to Destination Folder")
serviceExport := flag.Bool("se",false,"Export Service File")
yamlFileName := flag.String("f", "", "Yaml File Name")
srcFolder := flag.String("sc","", "Source Folder for Copy")
flag.Parse()
config.GetIniFileName();
if *testYaml == true && *yamlFileName != "" {
d := data.ImportYamlFile(*yamlFileName)
fmt.Printf("%+v\n\n",d)
}
if *exportToYaml == true && *yamlFileName != "" {
data.GenerateExampleYaml(*yamlFileName)
}
if *serviceExport == true && *yamlFileName != "" {
d := data.ImportYamlFile(*yamlFileName)
data.ExportServiceFiles(d)
}
if *copyToDirectory == true && *srcFolder != "" {
d := data.ImportYamlFile(*yamlFileName)
log.Printf("packmule: Copying From: %s To: %s",*srcFolder,d.HomeFolder)
data.CopyLocalFiles(d, *srcFolder)
}
}