Add pack.png file to init command
This commit is contained in:
parent
25890fc392
commit
d9a4debe37
Binary file not shown.
After Width: | Height: | Size: 2.6 KiB |
|
@ -33,6 +33,9 @@ pub fn init(
|
||||||
// Create the .gitignore file
|
// Create the .gitignore file
|
||||||
create_gitignore(path, verbose)?;
|
create_gitignore(path, verbose)?;
|
||||||
|
|
||||||
|
// Create the pack.png file
|
||||||
|
create_pack_png(path, verbose)?;
|
||||||
|
|
||||||
// Create the src directory
|
// Create the src directory
|
||||||
let src_path = path.join("src");
|
let src_path = path.join("src");
|
||||||
create_dir(&src_path, verbose)?;
|
create_dir(&src_path, verbose)?;
|
||||||
|
@ -101,3 +104,15 @@ fn create_gitignore(path: &Path, verbose: bool) -> std::io::Result<()> {
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn create_pack_png(path: &Path, verbose: bool) -> std::io::Result<()> {
|
||||||
|
let pack_png = path.join("pack.png");
|
||||||
|
fs::write(&pack_png, include_bytes!("../../assets/default-icon.png"))?;
|
||||||
|
if verbose {
|
||||||
|
print_info(&format!(
|
||||||
|
"Created pack.png file at {}.",
|
||||||
|
to_absolute_path(&pack_png)?
|
||||||
|
));
|
||||||
|
}
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue