-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathakpkg.ak
More file actions
64 lines (59 loc) · 1.97 KB
/
Copy pathakpkg.ak
File metadata and controls
64 lines (59 loc) · 1.97 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
55
56
57
58
59
60
61
62
63
64
## AK CODE Package Manager — CLI Entry Point
## Provides the command-line interface for the akpkg package manager
## Usage: akpkg <command> [package]
bring in stdlib pkg
define main taking args
if size of args is less than 2
show "AK Package Manager v1.0"
show "Usage: akpkg <command> [package]"
show ""
show "Commands:"
show " install [package] Install a package or all dependencies"
show " add <package> Add and install a package dependency"
show " remove <package> Remove a package dependency"
show " publish Publish the current project"
show " list List installed packages"
show " update <package> Check for package updates"
give back 1
end
let cmd = item 1 of args
let manager = new PackageManager
if cmd is "install"
if size of args is greater than 2
let pkg_name = item 2 of args
manager install taking pkg_name
else
manager install all
end
else if cmd is "add"
if size of args is greater than 2
let pkg_name = item 2 of args
manager add taking pkg_name
else
show "Usage: akpkg add <package-name>"
end
else if cmd is "remove"
if size of args is greater than 2
let pkg_name = item 2 of args
manager remove taking pkg_name
else
show "Usage: akpkg remove <package-name>"
end
else if cmd is "publish"
manager publish
else if cmd is "list"
manager list installed
else if cmd is "update"
if size of args is greater than 2
let pkg_name = item 2 of args
manager update taking pkg_name
else
show "Usage: akpkg update <package-name>"
end
else
show "Unknown command: " plus cmd
show "Usage: akpkg <command> [package]"
give back 1
end
give back 0
end