-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
79 lines (62 loc) · 1.02 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
package main
import (
"os"
)
const (
sampleDir = "./sample"
packageConfigFile = "package.rj"
//commandNeeded = "Please enter a task you "
nameNeeded = "Please specify a directory/project name."
fileExists = "File exists and is not a directory:"
dirExists = "Dir exists and not empty:"
)
var (
//tempDir string
executable string
simulator = true
)
func main() {
args := os.Args[1:]
l := len(args)
if l == 0 {
showHelp()
return
}
//cxt.initTask(args[0])
task := taskFromString(args[0])
if task == help {
showHelp()
return
} else {
if l < 2 {
showHelp()
return
}
ctx, ok := newContext()
if !ok {
showHelp()
return
}
if task == create {
createProject(args[1], ctx)
} else {
if l > 2 {
if args[2] == "-prod" {
ctx.isProd = true
}
}
ctx.loadConfig()
pkg, ok := getPackager(ctx, args[1])
if pkg.getPlatform() == unknown {
showHelp()
return
}
if !ok {
return
}
pkg.buildAndPack()
}
}
}
func showHelp() {
}