-
Notifications
You must be signed in to change notification settings - Fork 11
/
set_up.java
executable file
·28 lines (22 loc) · 1004 Bytes
/
set_up.java
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
///usr/bin/env java --enable-preview --source 21 -cp "*" "$0" "$@" ; exit $?
import static java.util.Map.entry;
import java.io.Console;
import java.util.List;
private Console console = System.console();
void main() {
var options = List.of(
entry("GitHub", prompt("Keep GitHub workflows and templates: (Yn)", "y")),
entry("GitLab", prompt("Keep GitLab workflows and templates: (Yn)", "y")),
entry("GitLab", prompt("Keep 'CODE_OF_CONDUCT.md' file: (Yn)", "y")),
entry("GitLab", prompt("Keep 'CONTRIBUTING.md' file: (Yn)", "y")),
entry("GitLab", prompt("Keep 'LICENSE.md' file: (Yn)", "y")),
entry("GitLab", prompt("Keep this set up file 'set_up.java' file: (Yn)", "y"))
);
// Rename artifacts, groups or base package
// Restart Git history (or delete it)
}
public String prompt(String message, String defaultValue) {
console.printf(message);
var v = console.readLine();
return v == null || v.isBlank() ? defaultValue : v;
}