fix(CI): do not log "ENOENT" when unlink fails after check (#10102)

* fix(CI): do not log "ENOENT" when unlink fails after check

* fix: await for mkdirp before continuing
This commit is contained in:
Pierre Brunet
2026-07-17 10:16:07 +02:00
committed by GitHub
parent d02098a397
commit 76fa4bba51

View File

@@ -32,7 +32,9 @@ async function checkFile(vhdName) {
try {
await fsPromise.unlink(target)
} catch (err) {
console.warn(err)
if (err.code !== 'ENOENT') {
console.warn(err)
}
}
}
}
@@ -71,7 +73,7 @@ exports.recoverRawContent = async function recoverRawContent(vhdName, rawName, o
// @ todo how can I call vhd-cli copy from here
async function convertToVhdDirectory(rawFileName, vhdFileName, path) {
fs.mkdirp(path)
await fs.mkdirp(path)
const srcVhd = await fs.open(vhdFileName, 'r')
@@ -108,7 +110,7 @@ async function convertToVhdDirectory(rawFileName, vhdFileName, path) {
exports.convertToVhdDirectory = convertToVhdDirectory
exports.createRandomVhdDirectory = async function createRandomVhdDirectory(path, sizeMB) {
fs.mkdirp(path)
await fs.mkdirp(path)
const rawFileName = `${path}/temp.raw`
await createRandomFile(rawFileName, sizeMB)
const vhdFileName = `${path}/temp.vhd`