2024-03-01 14:29:01 +03:00
|
|
|
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
2022-10-28 16:44:37 +03:00
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
|
2024-08-02 13:30:02 +03:00
|
|
|
use std::{error::Error, path::PathBuf};
|
|
|
|
use tauri_utils::{config::Config, write_if_changed};
|
2022-10-28 16:44:37 +03:00
|
|
|
|
|
|
|
pub fn main() -> Result<(), Box<dyn Error>> {
|
2024-08-02 13:30:02 +03:00
|
|
|
let schema = schemars::schema_for!(Config);
|
|
|
|
let schema = serde_json::to_string_pretty(&schema)?;
|
|
|
|
let out = PathBuf::from(std::env::var("CARGO_MANIFEST_DIR")?);
|
|
|
|
for path in ["schema.json", "../../tooling/cli/schema.json"] {
|
|
|
|
write_if_changed(out.join(path), &schema)?;
|
2022-10-28 16:44:37 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
Ok(())
|
|
|
|
}
|