Skip to content

Check if directory exists before recreating it with Windows CMD

Tomasz Maczukin requested to merge fix/fix-mkdir-on-windows-cmd into master

What does this MR do?

It makes func (b *CmdWriter) MkDir(path string) to work in case when directory already exists.

Why was this MR needed?

My tests show that on Windows with CMD md [directory] will fail if [directory] already exists. This is not a problem for mkdir -p [directory] on bash and for md [directory] -Force | out-nul on WIndows with PowerShell. And this is probably the cause of bug mentioned in #2024 (closed).

Are there points in the code the reviewer needs to double check?

The main change. It should be double checked manually on Windows with CMD.

Does this MR meet the acceptance criteria?

  • Documentation created/updated
  • Tests
    • Added for this feature/bug
    • All builds are passing
  • Branch has no merge conflicts with master (if you do - rebase it please)

What are the relevant issue numbers?

Fixes #2024 (closed), #2043 (closed)

Merge request reports