clippy
This commit is contained in:
parent
4f2de451e0
commit
9068325506
2 changed files with 9 additions and 3 deletions
|
@ -3,7 +3,13 @@ name = "installer_lite"
|
|||
version = "1.0.0"
|
||||
edition = "2021"
|
||||
authors = ["Djkáťo <djkatovfx@gmail.com>"]
|
||||
|
||||
license = "MIT OR Apache-2.0"
|
||||
description = "A simple Windows Installer creator for your apps."
|
||||
homepage = "https://github.com/djkato/installer-lite"
|
||||
repository = "https://github.com/djkato/installer-lite"
|
||||
readme = "README.md"
|
||||
keywords = ["installer", "windows", "wrapper"]
|
||||
categories = ["development-tools::build-utils", "gui", "development-tools"]
|
||||
[lib]
|
||||
name = "installer_lite"
|
||||
path = "src/lib.rs"
|
||||
|
|
|
@ -94,12 +94,12 @@ impl App for Installer {
|
|||
impl Installer {
|
||||
fn install(&mut self) -> Result<(), Box<dyn std::error::Error>> {
|
||||
let app_path = self.target_path.clone() + r"\" + &self.app_name + ".exe";
|
||||
if let Ok(_) = std::fs::read(&app_path) {
|
||||
if std::fs::read(&app_path).is_ok() {
|
||||
return Err("App already installed".into());
|
||||
};
|
||||
std::fs::create_dir_all(&self.target_path)?;
|
||||
self.installer_output += format!("\nCreating App folder: \n{}", &self.target_path).as_str();
|
||||
std::fs::write(&app_path, &self.executable)?;
|
||||
std::fs::write(&app_path, self.executable)?;
|
||||
self.installer_output += "\nCopying executable to folder";
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue