Skip to content

Commit aef60ec

Browse files
committed
eula things
1 parent 9777065 commit aef60ec

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/target
22
server.jar
3+
eula.txt
34
.DS_Store

src/main.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
3939
io::stdin().read_line(&mut line)?;
4040
let line = line.trim();
4141

42-
if line != "y" {
42+
if line == "y" {
43+
let mut eula_file = File::create("eula.txt")?;
44+
writeln!(eula_file, "eula=true")?;
45+
println!("EULA accepted and eula.txt file created.");
46+
} else {
4347
println!("Exiting...");
4448
process::exit(1);
4549
}
@@ -83,4 +87,4 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
8387
}
8488

8589
Ok(())
86-
}
90+
}

0 commit comments

Comments
 (0)