Skip to content
Snippets Groups Projects
Unverified Commit c56a98b9 authored by Alexander Theißen's avatar Alexander Theißen Committed by GitHub
Browse files

pallet-revive-fixtures: Try not to re-create fixture dir (#6735)


On some systems trying to re-create the output directory will lead to an
error.

Fixes https://github.com/paritytech/subxt/issues/1876

---------

Co-authored-by: default avatarBastian Köcher <git@kchr.de>
parent 76a292b2
No related merge requests found
Pipeline #507958 waiting for manual action with stages
in 2 minutes and 58 seconds
......@@ -204,10 +204,15 @@ fn create_out_dir() -> Result<PathBuf> {
.join("pallet-revive-fixtures");
// clean up some leftover symlink from previous versions of this script
if out_dir.exists() && !out_dir.is_dir() {
let mut out_exists = out_dir.exists();
if out_exists && !out_dir.is_dir() {
fs::remove_file(&out_dir)?;
out_exists = false;
}
if !out_exists {
fs::create_dir(&out_dir).context("Failed to create output directory")?;
}
fs::create_dir_all(&out_dir).context("Failed to create output directory")?;
// write the location of the out dir so it can be found later
let mut file = fs::File::create(temp_dir.join("fixture_location.rs"))
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment