Skip to content

Commit

Permalink
Release 0.1.8: trash generated schema before generating new one
Browse files Browse the repository at this point in the history
  • Loading branch information
finnhodgkin committed Oct 2, 2024
1 parent da165e3 commit 7e6c5dc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rust-purs-gql"
version = "0.1.7"
version = "0.1.8"
edition = "2021"
default-run = "pursgql"
repository = "https://github.com/OxfordAbstracts/purescript-graphql-schema-gen"
Expand Down
12 changes: 12 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use std::{
fs::remove_dir_all,
sync::{Arc, Mutex},
thread::Result,
};
Expand Down Expand Up @@ -30,6 +31,17 @@ async fn main() -> Result<()> {
// Fetch the workspace config
let workspace_config = parse_workspace().await?;

// Trash existing schema
for path in vec![
workspace_config.postgres_enums_dir.clone(),
workspace_config.shared_graphql_enums_dir.clone(),
workspace_config.schema_libs_dir.clone(),
]
.iter()
{
remove_dir_all(path).ok();
}

// Generate postgres enum types
let postgres_types = fetch_types(&workspace_config)
.await
Expand Down

0 comments on commit 7e6c5dc

Please sign in to comment.