Skip to content

Commit

Permalink
Move auto folder removal into gir directly
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Nov 18, 2021
1 parent 3bd0a6e commit e754270
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 0 additions & 3 deletions generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import subprocess
import sys
import asyncio
import shutil

DEFAULT_GIR_FILES_DIRECTORY = Path("./gir-files")
DEFAULT_GIR_DIRECTORY = Path("./gir/")
Expand Down Expand Up @@ -137,8 +136,6 @@ def regen_crates(path, conf):
else:
if is_sys_crate:
args.extend(["-m", "sys"])
else:
shutil.rmtree(path.parent / "src/auto")

async def regenerate_crate(path, args):
return "==> Regenerating `{}`...\n".format(path) + await spawn_gir(
Expand Down
4 changes: 4 additions & 0 deletions src/config/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,10 @@ impl Config {
None if work_mode == WorkMode::Normal => target_path.join("src").join("auto"),
None => target_path.join("src"),
};
if work_mode == WorkMode::Normal {
std::fs::remove_dir_all(&auto_path)
.map_err(|e| format!("remove_dir_all failed: {:?}", e))?;
}

let doc_target_path: PathBuf = match doc_target_path.into() {
Some("") | None => match toml.lookup("options.doc_target_path") {
Expand Down

0 comments on commit e754270

Please sign in to comment.