Skip to content

Commit

Permalink
fix: compile contracts before generating docs (#7369)
Browse files Browse the repository at this point in the history
* fix: compile before doc

* run forge compile silently

---------

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
  • Loading branch information
kamuik16 and mattsse authored Mar 12, 2024
1 parent dbddd08 commit d3b8d15
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/forge/bin/cmd/doc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use forge_doc::{
ContractInheritance, Deployments, DocBuilder, GitSource, InferInlineHyperlinks, Inheritdoc,
};
use foundry_cli::opts::GH_REPO_PREFIX_REGEX;
use foundry_common::compile::ProjectCompiler;
use foundry_config::{find_project_root_path, load_config_with_root};
use std::{path::PathBuf, process::Command};

Expand Down Expand Up @@ -64,6 +65,9 @@ impl DocArgs {
pub fn run(self) -> Result<()> {
let root = self.root.clone().unwrap_or(find_project_root_path(None)?);
let config = load_config_with_root(Some(root.clone()));
let project = config.project()?;
let compiler = ProjectCompiler::new().quiet(true);
let _output = compiler.compile(&project)?;

let mut doc_config = config.doc.clone();
if let Some(out) = self.out {
Expand Down

0 comments on commit d3b8d15

Please sign in to comment.