Skip to content

Commit

Permalink
Commented out dead code for now
Browse files Browse the repository at this point in the history
  • Loading branch information
mbround18 committed Apr 21, 2024
1 parent 1328612 commit 5b44b05
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions src/odin/files/mod.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
pub mod config;
pub mod discord;

use crate::executable::create_execution;
// use crate::executable::create_execution;
use crate::utils::get_working_dir;
use log::{debug, error, info};
use std::fs;
use std::fs::{create_dir_all, remove_file, File};
use std::fs::{create_dir_all, File};
use std::io::Write;
use std::path::Path;
use std::process::exit;
Expand All @@ -26,18 +26,18 @@ pub trait FileManager {
fn exists(&self) -> bool {
Path::new(self.path().as_str()).exists()
}
fn remove(&self) -> bool {
match remove_file(self.path()) {
Ok(_) => {
info!("Successfully deleted {}", self.path());
true
}
Err(_) => {
error!("Did not find or could not delete {}", self.path());
false
}
}
}
// fn remove(&self) -> bool {
// match remove_file(self.path()) {
// Ok(_) => {
// info!("Successfully deleted {}", self.path());
// true
// }
// Err(_) => {
// error!("Did not find or could not delete {}", self.path());
// false
// }
// }
// }
fn read(&self) -> String {
if self.exists() {
fs::read_to_string(self.path()).unwrap()
Expand All @@ -60,18 +60,18 @@ pub trait FileManager {
}
}
}
fn set_executable(&self) -> bool {
if let Ok(_output) = create_execution("chmod")
.args(["+x", self.path().as_str()])
.output()
{
info!("Successfully set {} to executable", self.path());
true
} else {
error!("Unable to set {} to executable", self.path());
false
}
}
// fn set_executable(&self) -> bool {
// if let Ok(_output) = create_execution("chmod")
// .args(["+x", self.path().as_str()])
// .output()
// {
// info!("Successfully set {} to executable", self.path());
// true
// } else {
// error!("Unable to set {} to executable", self.path());
// false
// }
// }
}

pub struct ManagedFile {
Expand Down

0 comments on commit 5b44b05

Please sign in to comment.