Skip to content

Commit

Permalink
build: make all build steps optional
Browse files Browse the repository at this point in the history
  • Loading branch information
max-niederman committed May 17, 2021
1 parent b35c133 commit 6dff1a0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
8 changes: 2 additions & 6 deletions build.rs
Expand Up @@ -39,21 +39,17 @@ fn copy<U: AsRef<Path>, V: AsRef<Path>>(from: U, to: V) -> std::io::Result<()> {

#[allow(unused_must_use)]
fn main() -> std::io::Result<()> {
if env::var_os("NO_RESOURCES").is_some() {
return Ok(());
}

let install_path = dirs::config_dir()
.expect("Couldn't find a configuration directory to install to.")
.join("ttyper");
fs::remove_dir_all(&install_path);
fs::create_dir_all(&install_path)?;
fs::create_dir_all(&install_path);

let resources_path = env::current_dir()
.expect("Couldn't find the source directory.")
.join("resources")
.join("runtime");
copy(&resources_path, &install_path)?;
copy(&resources_path, &install_path);

Ok(())
}
2 changes: 1 addition & 1 deletion src/main.rs
Expand Up @@ -56,7 +56,7 @@ impl Opt {
.join("language")
.join(&self.language)
});
let file = fs::File::open(path).expect("Error reading language file.");
let file = fs::File::open(path).expect("Error reading language file. Make sure Luthien's config dir isn't missing.");
io::BufReader::new(file)
.lines()
.filter_map(Result::ok)
Expand Down

0 comments on commit 6dff1a0

Please sign in to comment.