MCPcopy Create free account
hub / github.com/Nariod/RustPacker / process_output

Function process_output

src/tools.rs:77–102  ·  view source on GitHub ↗
(order: &arg_parser::Order, output_folder_path: &Path)

Source from the content-addressed store, hash-verified

75}
76
77pub fn process_output(order: &arg_parser::Order, output_folder_path: &Path) -> io::Result<()> {
78 let output_path = match &order.output {
79 Some(p) => p,
80 None => return Ok(()),
81 };
82
83 if let Some(parent) = output_path.parent() {
84 if !parent.exists() {
85 fs::create_dir_all(parent)?;
86 }
87 }
88
89 let source_binary = get_source_binary_filename(order, output_folder_path);
90
91 if !source_binary.is_file() {
92 return Err(io::Error::new(
93 io::ErrorKind::NotFound,
94 format!("Source file does not exist: {:?}", source_binary),
95 ));
96 }
97
98 fs::copy(&source_binary, output_path)?;
99 println!("[+] Your binary has been written here: {:?}", output_path);
100
101 Ok(())
102}
103
104pub fn generate_random_filename(order: &arg_parser::Order) -> String {
105 let mut rng = rand::rng();

Callers 1

mainFunction · 0.85

Calls 1

Tested by

no test coverage detected