use std::fs;
use std::path::Path;
const STUB_HTML: &str = r#"<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>giff dashboard</title>
<style>
body { font-family: -apple-system, system-ui, sans-serif; margin: 4rem; color: #222; }
code { background: #f4f4f4; padding: 0.15em 0.4em; border-radius: 4px; }
</style>
</head>
<body>
<h1>giff dashboard</h1>
<p>This binary was built without the SvelteKit dashboard assets.</p>
<p>If you cloned the repo and ran <code>cargo install --path crates/giff-cli</code>,
build the dashboard first:</p>
<pre><code>cd apps/web && npm install && npm run build
cp -r build ../../crates/giff-cli/dashboard-dist
cargo install --path crates/giff-cli --force</code></pre>
<p>Or install the published crate, which ships a real build:
<code>cargo install giffstack --force</code>.</p>
</body>
</html>
"#;
fn main() {
let dist = Path::new("dashboard-dist");
if !dist.join("index.html").exists() {
fs::create_dir_all(dist).expect("creating dashboard-dist/");
fs::write(dist.join("index.html"), STUB_HTML).expect("writing stub index.html");
}
println!("cargo:rerun-if-changed=dashboard-dist");
}