161: put mini-dashboard in out-dir r=MarinPostma a=MarinPostma

This PR puts the mini-dashboard during build in the `OUT_DIR` specified by cargo. This allow the mini-dashboard artifacts to be cleaned when `cargo clean` is ran, and not pollute the working directory with unwanted files.


Co-authored-by: Marin Postma <postma.marin@protonmail.com>
This commit is contained in:
bors[bot] 2021-04-27 07:40:23 +00:00 committed by GitHub
commit d34d7cbc37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

2
.gitignore vendored
View File

@ -5,5 +5,3 @@
/*.mdb
/query-history.txt
/data.ms
/meilisearch-http/mini-dashboard
/meilisearch-http/.mini-dashboard.sha1

View File

@ -28,9 +28,10 @@ mod mini_dashboard {
pub fn setup_mini_dashboard() -> anyhow::Result<()> {
let cargo_manifest_dir = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap());
let cargo_toml = cargo_manifest_dir.join("Cargo.toml");
let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap());
let sha1_path = cargo_manifest_dir.join(".mini-dashboard.sha1");
let dashboard_dir = cargo_manifest_dir.join("mini-dashboard");
let sha1_path = out_dir.join(".mini-dashboard.sha1");
let dashboard_dir = out_dir.join("mini-dashboard");
let manifest = Manifest::from_path(cargo_toml).unwrap();