use std::fs;
use uuid::Uuid;
use crate::dirs;
pub fn get_device_id() -> String {
let mut path = dirs::get_data_dir().unwrap();
path.push("device_id");
if path.exists() {
fs::read_to_string(path).unwrap()
} else {
let uuid = Uuid::new_v4().to_hyphenated().to_string();
fs::write(path, &uuid).unwrap();
uuid
}
}