-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.ab
More file actions
executable file
·54 lines (49 loc) · 1.37 KB
/
main.ab
File metadata and controls
executable file
·54 lines (49 loc) · 1.37 KB
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
import { build_cmd } from "./cli/build.ab"
import { check_dotfiles } from "./utils/file.ab"
main (_args) {
let distro_name=""
let distro_version=""
let components=""
let arch=""
let sources=""
let device=""
let base_type="minimal"
let image_size="0"
let command = _args[1]
let build_tag = _args[2] // board rootimg
for i, arg in _args {
if {
arg == "--name" or arg == "-n" {
distro_name = _args[i+1]
}
arg == "--distro" or arg == "-d" {
distro_version = _args[i+1]
}
arg == "--components" or arg == "-c"{
components = _args[i+1]
}
arg == "--arch" or arg == "-a" {
arch = _args[i+1]
}
arg == "--sources" or arg == "-s" {
sources = _args[i+1]
}
arg == "--base-type" {
base_type = _args[i+1]
}
arg == "--device" {
device = _args[i+1]
}
arg == "--image-size" {
image_size = _args[i+1]
}
}
}
// 检查配置目录
check_dotfiles()
if {
command == "build" {
build_cmd(build_tag, distro_name, distro_version, components, arch, sources, base_type, device, image_size)
}
}
}