-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
9 changed files
with
150 additions
and
15 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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
use tokio::fs; | ||
|
||
pub async fn make_dir(output_directory: &str) { | ||
if fs::metadata(output_directory).await.is_ok() { | ||
if let Err(e) = fs::remove_dir_all(output_directory).await { | ||
eprintln!( | ||
"Error removing output directory {}: {:?}", | ||
output_directory, e | ||
); | ||
return; | ||
} | ||
} | ||
|
||
if let Err(e) = fs::create_dir_all(output_directory).await { | ||
eprintln!( | ||
"Error creating output directory {}: {:?}", | ||
output_directory, e | ||
); | ||
return; | ||
} | ||
} |
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,7 +1,9 @@ | ||
pub use self::copy_dir_recursive::copy_dir_recursive; | ||
pub use self::get_current_directory::get_current_directory; | ||
pub use self::get_dist_path::get_dist_path; | ||
pub use self::make_dir::make_dir; | ||
|
||
pub mod copy_dir_recursive; | ||
pub mod get_current_directory; | ||
pub mod get_dist_path; | ||
pub mod make_dir; |
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,15 @@ | ||
fn parse_args(version: &str) -> Cli { | ||
use clap::FromArgMatches; | ||
|
||
let version_static: &'static str = | ||
Box::leak(version.to_string().into_boxed_str()); | ||
|
||
let mut cmd = Cli::command(); | ||
cmd = cmd.version(version_static); | ||
let matches = cmd.get_matches(); | ||
|
||
match Cli::from_arg_matches(&matches) { | ||
Ok(cli) => cli, | ||
Err(e) => e.exit(), | ||
} | ||
} |
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