/
install.ts
69 lines (63 loc) 路 1.88 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
import { brightGreen, cyan, gray, green, red } from "./deps/colors.ts";
import { checkDenoVersion } from "./core/utils.ts";
const denoInfo = checkDenoVersion();
if (denoInfo) {
console.log("----------------------------------------");
console.error(red("Error installing Lume"));
console.log(`Lume needs Deno ${green(denoInfo.minimum)} or greater`);
console.log(`Your current version is ${red(denoInfo.current)}`);
console.log(`Run ${cyan(denoInfo.command)} and try again`);
console.log("----------------------------------------");
Deno.exit(1);
}
const process = Deno.run({
cmd: [
Deno.execPath(),
"install",
"--unstable",
"-Af",
`--no-check`,
"--name=lume",
new URL("./ci.ts", import.meta.url).href,
],
});
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://lume.land")} for online documentation`,
);
console.log(
`See ${
gray("https://discord.gg/YbTmpACHWB")
} to propose new ideas and get help at Discord`,
);
console.log(
`See ${gray("https://opencollective.com/lume")} to provide some support`,
);
console.log();
}