-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mrpack export, packwiz import/export
- Loading branch information
1 parent
f1e1818
commit a750826
Showing
31 changed files
with
1,929 additions
and
337 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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,3 +1,11 @@ | ||
# mcman | ||
# generated by mcman | ||
|
||
# exclude server output directory | ||
server/ | ||
|
||
# dont include the dotenv | ||
.env | ||
|
||
# exclude exported packs | ||
*.zip | ||
*.mrpack |
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
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
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
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
use std::fs; | ||
|
||
use anyhow::{Result, Context}; | ||
use clap::Command; | ||
use console::style; | ||
use dialoguer::{Input, theme::ColorfulTheme}; | ||
|
||
use crate::model::Server; | ||
|
||
pub fn cli() -> Command { | ||
Command::new("eject") | ||
.hide(true) | ||
.about("Eject - remove everything related to mcman") | ||
} | ||
|
||
pub async fn run() -> Result<()> { | ||
let server = Server::load().context("Failed to load server.toml")?; | ||
|
||
if Input::with_theme(&ColorfulTheme::default()) | ||
.with_prompt("Are you sure you want to delete everything? This is irreversible. Type this server's name to confirm.") | ||
.default(String::new()) | ||
.interact_text()? == server.name { | ||
println!(" > {}", style("Deleting server.toml...").yellow()); | ||
_ = fs::remove_file(server.path.join("server.toml"))?; | ||
Check failure on line 24 in src/commands/eject.rs GitHub Actions / clippythis let-binding has unit value
|
||
println!(" > {}", style("Deleting config/...").yellow()); | ||
_ = fs::remove_dir_all(server.path.join("config")); | ||
println!(" > {}", style("Deleting server/...").yellow()); | ||
_ = fs::remove_dir_all(server.path.join("server"))?; | ||
Check failure on line 28 in src/commands/eject.rs GitHub Actions / clippythis let-binding has unit value
|
||
println!(" > Ejected successfully."); | ||
} else { | ||
println!(" > {}", style("Cancelled").green().bold()); | ||
} | ||
|
||
Ok(()) | ||
} | ||
Check warning on line 35 in src/commands/eject.rs GitHub Actions / clippyunused `async` for function with no await statements
|
Oops, something went wrong.