summaryrefslogtreecommitdiff
path: root/build.rs
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2021-09-05 14:37:06 +0100
committerDaniel Silverstone <dsilvers@digital-scurf.org>2021-09-05 14:37:06 +0100
commit52293448680bbbd81c78bc7b6c1350d034d6b660 (patch)
treec0ba491b1ba1e877d2f5255b16e7a07cf7d17465 /build.rs
parent1b9e94cc2367d5caf673fd4d6e8d814554a7ed1a (diff)
downloadsubplot-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.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/build.rs b/build.rs
index e86db58..2f2cefb 100644
--- a/build.rs
+++ b/build.rs
@@ -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)
}