-
Notifications
You must be signed in to change notification settings - Fork 0
/
cli.ts
48 lines (45 loc) · 1.48 KB
/
cli.ts
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
// deno run --allow-all cli.ts
// deno run --allow-all cli.ts g_[id].ts todos server_dev.ts
// deno run --allow-all cli.ts g_.ts todos
// deno run --allow-all cli.ts g_.ts oak_fs_routing_ui
// deno run --allow-all cli.ts g_test[id].ts child/todo
// deno run --allow-all cli.ts p_.ts oak_fs_routing_ui
import { OakFileSysRouting } from "./cli/oakFileSysRouting.ts";
let isMatch = false;
if (!isMatch && Deno.args.length == 4) {
isMatch = true;
const o = new OakFileSysRouting();
o.getFullMapping(
Deno.args[0],
Deno.args[1],
Deno.args[2],
Deno.args[3],
);
}
if (!isMatch && Deno.args.length == 3) {
isMatch = true;
const o = new OakFileSysRouting();
o.getFullMapping(Deno.args[0], Deno.args[1], Deno.args[2]);
}
if (!isMatch && Deno.args.length == 2) {
isMatch = true;
const o = new OakFileSysRouting();
o.getFullMapping(Deno.args[0], Deno.args[1]);
}
if (!isMatch && Deno.args.length == 1) {
isMatch = true;
const o = new OakFileSysRouting();
o.getFullMapping(Deno.args[0], "./");
}
if (!isMatch) {
console.log(" you need to write command with right pararams");
console.log("only one command ");
console.log(
" deno run --allow-all cli.ts {filename} {relative directory path} ",
);
console.log(" example : ");
console.log("deno run --allow-all cli.ts g_.ts todos");
console.log("todos directory must exist in pagesCtrl");
console.log("start template will be in ... github");
console.log(" deno run --allow-all cli.ts g_[id].ts todos");
}