Skip to content

Commit

Permalink
use built-in path to support different system
Browse files Browse the repository at this point in the history
  • Loading branch information
wznmickey committed Sep 13, 2024
1 parent 5b744c8 commit 244c134
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions src/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use std::cell::RefCell;
use std::fmt::Write;
use std::fs;
use std::fs::*;
use std::path::Path;
use std::rc::Rc;
use std::time::{SystemTime, UNIX_EPOCH};

Expand Down Expand Up @@ -103,24 +104,18 @@ impl Account {
let pb = ProgressBar::new(self.folders.len() as u64);
for folder in &self.folders {
let folder = folder.borrow();

if self.config.allow_term {
create_dir_all(
self.config.local_place.clone()
+ "/"
+ &folder.course.borrow().term_name
+ "/"
+ &folder.course.borrow().name
+ " "
+ &folder.fullname,
Path::new(&self.config.local_place)
.join(&folder.course.borrow().term_name)
.join(folder.course.borrow().name.clone() + " " + &folder.fullname),
)
.unwrap();
} else {
create_dir_all(
self.config.local_place.clone()
+ "/"
+ &folder.course.borrow().name
+ " "
+ &folder.fullname,
Path::new(&self.config.local_place)
.join(folder.course.borrow().name.clone() + " " + &folder.fullname)
)
.unwrap();
}
Expand Down

0 comments on commit 244c134

Please sign in to comment.