-
-
Notifications
You must be signed in to change notification settings - Fork 75
/
install.ts
71 lines (65 loc) 路 1.81 KB
/
install.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import { brightGreen, gray, red } from "./deps/colors.ts";
import { cli, importMap } from "./ci.ts";
const minDenoVersion = "1.13.1";
if (Deno.version.deno < minDenoVersion) {
console.log();
console.error(red("Error installing Lume"));
console.log("You have an old version of Deno");
console.log(`Lume needs Deno ${brightGreen(minDenoVersion)} or greater`);
console.log(`Your current version is ${red(Deno.version.deno)}`);
console.log();
console.log(
`Run ${brightGreen("deno upgrade")} before installing or upgrading Lume`,
);
console.log();
Deno.exit(1);
}
const process = Deno.run({
cmd: [
Deno.execPath(),
"install",
"--unstable",
"-Af",
`--import-map=${importMap}`,
`--no-check`,
"--name=lume",
cli,
],
});
const status = await process.status();
process.close();
if (!status.success) {
console.log();
console.error(red("Error installing Lume"));
console.log(
`You can report an issue at ${
gray("https://github.com/lumeland/lume/issues/new")
}`,
);
console.log(
`Or get help at Discord: ${gray("https://discord.gg/YbTmpACHWB")}`,
);
console.log();
Deno.exit(1);
}
if (Deno.args[0] !== "--upgrade") {
console.log();
console.log("馃敟馃敟馃敟馃敟馃敟馃敟馃敟馃敟馃敟馃敟馃敟馃敟馃敟馃敟馃敟馃敟");
console.log();
console.log(brightGreen(" Lume installed successfully!"));
console.log();
console.log(" BENVIDO - WELCOME! 馃帀馃帀");
console.log();
console.log(gray("-------------------------------"));
console.log();
console.log(`Run ${brightGreen("lume --help")} for usage information`);
console.log(
`See ${gray("https://lumeland.github.io/")} for online documentation`,
);
console.log(
`See ${
gray("https://discord.gg/YbTmpACHWB")
} to propose new ideas and get help at Discord`,
);
console.log();
}