-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
executable file
·67 lines (61 loc) · 1.48 KB
/
index.js
File metadata and controls
executable file
·67 lines (61 loc) · 1.48 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
65
66
67
#! /usr/bin/env node
const args = process.argv.slice(2);
const log = console.log;
const apply = Symbol("apply");
const commands = {
help: {
[apply]() {
log("Help")
}
},
node: {
[apply]() {
// See: https://nodejs.org/dist/latest-v18.x/SHASUMS256.txt
// And: https://nodejs.org/dist/latest/SHASUMS256.txt
log("LTS: 18.16.1, Latest: 20.4.0")
},
lts: {
[apply]() {
// See: https://github.com/nodejs/release#release-schedule
log("Current LTS: 18.16.1")
log("👑 Version 20 takes over LTS: 2023-10-24")
log("🔧 Maintenance start: 2023-10-18")
log("💀 End of life: 2025-04-30")
// log("LTS start: 2022-10-25")
},
}
},
react: {
[apply]() {
log("18.2.0")
},
},
rust: {
[apply]() {
// See: https://blog.rust-lang.org
log("1.71.0 released July 13 2023:");
log("- stabilizes C-unwind.");
log("- stabilizes debug_visualizer attribute for embedding data structure visualizations.");
log("- raw-dylib linking on Windows for easier builds.");
log("Read more: https://blog.rust-lang.org/2023/07/13/Rust-1.71.0.html");
},
},
};
let lookup = commands;
for (const arg of args) {
if (arg in lookup) {
lookup = lookup[arg]
} else {
lookup = null;
break;
}
}
if (lookup === null) {
log("Unknown command:", args.join(' '));
}
else if (apply in lookup) {
lookup[apply]();
} else {
commands.help[apply]();
}
process.exit(0);