Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
overseer: simplify debugging some more
Browse files Browse the repository at this point in the history
  • Loading branch information
drahnr committed Oct 11, 2021
1 parent 70ccebc commit 8f99eec
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ polkadot.*
.DS_Store
.cargo
.env
**/overlord-expansion.rs
13 changes: 9 additions & 4 deletions node/overseer/overseer-gen/proc-macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,11 @@ pub(crate) fn impl_overseer_gen(
additive.extend(impl_message_wrapper_enum(&info)?);
additive.extend(impl_dispatch(&info));

#[cfg(feature = "expansion")]
{
if cfg!(feature = "expansion") {
use std::io::Write;

let cwd = std::env::current_dir().unwrap();
let path: std::path::PathBuf = cwd.join("overlord-expansion.rs");
let path = cwd.join("overlord-expansion.rs");
let mut f = std::fs::OpenOptions::new()
.write(true)
.create(true)
Expand All @@ -120,6 +119,12 @@ pub(crate) fn impl_overseer_gen(
.current_dir(cwd)
.spawn()
.expect("Running rustfmt works. qed");

let path = path.display().to_string();
Ok(quote! {
include!( #path );
})
} else {
Ok(additive)
}
Ok(additive)
}

0 comments on commit 8f99eec

Please sign in to comment.