diff options
author | Daniel Silverstone <dsilvers@digital-scurf.org> | 2021-09-05 14:37:06 +0100 |
---|---|---|
committer | Daniel Silverstone <dsilvers@digital-scurf.org> | 2021-09-05 14:37:06 +0100 |
commit | 52293448680bbbd81c78bc7b6c1350d034d6b660 (patch) | |
tree | c0ba491b1ba1e877d2f5255b16e7a07cf7d17465 /build.rs | |
parent | 1b9e94cc2367d5caf673fd4d6e8d814554a7ed1a (diff) | |
download | subplot-52293448680bbbd81c78bc7b6c1350d034d6b660.tar.gz |
build.rs: Report if share tree is empty
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
Diffstat (limited to 'build.rs')
-rw-r--r-- | build.rs | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -16,7 +16,7 @@ //! if set, it causes a resource fallback path of `/usr/share/subplot` to be //! added to the resources search path automatically. -use anyhow::Result; +use anyhow::{anyhow, Result}; use std::io::Write; use std::path::{Component, Path, PathBuf}; use walkdir::WalkDir; @@ -91,6 +91,13 @@ fn gather_share_files() -> Result<Vec<PathBuf>> { ret.push(entry_path.into()); } + if ret.is_empty() { + return Err(anyhow!( + "Unable to find any resources in `{}`", + base_path.display() + )); + } + Ok(ret) } |