Skip to content

mkdirSyncRecursive() shouldn't fail when directory exists unexpectedly #1018

@rivy

Description

@rivy

When using shx mkdir -p ..., occasional, unnecessarily terminal, errors can occur if the target directory is created by another process during the execution of mkdirSyncRecursive().

It's an obvious race condition that I've run into occasionally when using shx for builds with multiple parallel steps (eg, https://github.com/rivy/js.xdg-portable/runs/1896221924?check_suite_focus=true)

Ignoring 'EEXIST' errors in mkdirSyncRecursive() can mitigate this problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixBug/defect, or a fix for such a problem

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions