typeracer 1.0.10

A terminal typing game. Race to see the fastest time you can get!
1
2
3
4
5
6
7
8
9
10
11
12
use directories::ProjectDirs;
use std::fs;

pub fn create_data_dir() -> String {
    let dirs = ProjectDirs::from("org", "darrienglasser.com", "typeracer").unwrap();
    fs::create_dir_all(dirs.data_dir()).expect("Failed to create data dir");
    dirs.data_dir().to_str().unwrap().to_string()
}

pub fn get_quote_dir() -> String {
    format!("{}/{}", create_data_dir(), "quote-pack").to_string()
}