From d9a4debe3780da91b6ba383b308afe0de4f26db1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20H=C3=B6lting?= <87192362+moritz-hoelting@users.noreply.github.com> Date: Fri, 29 Mar 2024 19:26:31 +0100 Subject: [PATCH] Add pack.png file to init command --- assets/default-icon.png | Bin 0 -> 2686 bytes src/subcommands/init.rs | 15 +++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 assets/default-icon.png diff --git a/assets/default-icon.png b/assets/default-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..bbe0c7a76770914dbbc28cce73cfce904421ede8 GIT binary patch literal 2686 zcmai0dt6iJ84e;=K`vU0Qbl7d0wTEyQ9?q1076HAk|@FQLqc*0XON4@0TK#HKpise zlxn3Di$b^Ir65CKhy{vVr&bt(R+&(N83$wmxtApDB-})B`{N|}zUO_O_xgP&nIS<3 z%}qZxMIaF70scOr@V7$$tX&0v21bluMj%#~f($0aqy-Y$0v?*h5kv!M2~P;)2n2~D z5wh5E0ECPNxFDa5Qs1pXAwdoq73NCA(u7nX7W7XR0rcb`20J;9?Z!b-JWNRvA}qiI zAQn=>i|31p5;Dr5ON4*xw=pQB!32sUqnNZ1Bvl{+kgjM~G#2GyiX@3RF~m?Gzd16z zBBNp;>;KC(o4*0_yA(I2oyq~ zfREH`vZ4hE5E+GnapashAORQE`Qo|s;X+{a2nL77V%|1~z?k=#>yc&V!dL+$5XTCH z3kfW7u>db4!sT0;B4G(vGN#e~w>giuBn>g-n+O+TuBc05ns*>(NQD3<6c7s%L~Ot} z5#U3+43*H=g%|=#fOw`4$OHIdxVmH%4u9YsH2i%iRS+)_(c!TIV48uXuN^Uf$KnEE zAP0(FR9gfB0X}ybqK_^4^3 zi%;Kv7ry5Cu88jNv9~46Zk<_p?JL+`c*z9U{84ns} z9Emh^n#f}7i$q2VMFLI&8{in6!*a8zSP%mxu|$9u7j7~c9BmVekU#j~{$RlE6`@5b6| zG?8?jbX(H8jqxU(iuBmto2@mTpVuC-+T?2$7w5axTp6+P)TuuLiPc)wqhfcna?enj z%~;*JPq_)*XAXv26ghl(>*s&x8QXvA?^7asLpdp^kbV8gO6TWE~L^RyMRff=_*V-nxxy_jfe^bi*&I_0Q9P`QhZN z4pGaV>B}D8QS|EmHRG01o{!w0$PkIoxvIL7p$hnou}h+J&*G?8&5eVbn z03R=gmxsBOl>5VqA8$g?nl(Ler-R?VORg+Ktm6zhO z*MEFUH9D;9{Ukb}%(PQb#J@NGpE9$~&TK-q+`%S%*#62faVJ%`@eM07O?E^w zbB@}pdzNx3V~Cc=BSyBgjNkfFYHSE6;# z+TK)9nRE45+kWVW++Xe5XB5NQL0w;ezGWK8JPBk-nC)ne01t~IEYkA-3B4AVA zD_i?I+r?eIJg@a?O9e6e$;_zw7$s^<6*#h5c|=Ja$a*3&!XqrJkP$M{7F2y zs^j(;DwpC<9h<)M$mIT4gV_%YMvAM@!xOhtpT+e26vld&RX4pe<>kxqo$&=DC)--q zU9HS5vM(7iDz=OYZ<TDNCHQz_1aRW z<_zU%+X0U*O8YcKDMhaxNbR5aQ9C`g!VJ0Sbkg5%?!t8SB$tD|Vi(Z%GuP8iP1hs& z#O9;kx@~VTNcfOt3~L)mkJJ{!;*T}UM@nNd`CxrUy@u(b|JxYg8{|{u9hLrH6<#zs literal 0 HcmV?d00001 diff --git a/src/subcommands/init.rs b/src/subcommands/init.rs index a25fb6a..752472f 100644 --- a/src/subcommands/init.rs +++ b/src/subcommands/init.rs @@ -33,6 +33,9 @@ pub fn init( // Create the .gitignore file create_gitignore(path, verbose)?; + // Create the pack.png file + create_pack_png(path, verbose)?; + // Create the src directory let src_path = path.join("src"); create_dir(&src_path, verbose)?; @@ -101,3 +104,15 @@ fn create_gitignore(path: &Path, verbose: bool) -> std::io::Result<()> { } 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(()) +}