-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bec901d
commit 7389d3f
Showing
1 changed file
with
22 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,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() { | ||
System.out.println("Set up project"); | ||
// Ask to keep Git hosting files | ||
// Ask to keep extra documents | ||
// Ask to keep this file | ||
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; | ||
} |