-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.ts
40 lines (32 loc) · 1.02 KB
/
main.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
import { base } from "./templates/base.ts";
import { deno } from "./templates/deno.ts";
import { deps } from "./templates/deps.ts";
console.log("Create directory...");
Deno.mkdir("./denops/plugin", { recursive: true });
console.log("Copying templates...");
Deno.writeTextFile("./denops/plugin/main.ts", base);
Deno.writeTextFile("./deps.ts", deps);
Deno.writeTextFile("./deno.json", deno);
console.log("Execute `deno cache ./denops/plugin/main.ts`...");
const cache = new Deno.Command(
"deno",
{
args: ["cache", "./denops/plugin/main.ts"],
},
);
const { _, stdout, stderr } = await cache.output();
const decoder = new TextDecoder();
console.log(decoder.decode(stdout));
console.log(decoder.decode(stderr));
console.log("All done 🎉");
console.log(`Boiler plate structure is show below.
You edit to \`main.ts\` start develop to denops plugin.`);
console.log(`.
├── deno.json
├── deno.lock
├── denops
│ └── plugin
│ └── main.ts
└── deps.ts
`);
console.log("Happy hacking!✨");