Skip to content

enhancement: auto-create destination directory on extract #78

@bug-ops

Description

@bug-ops

Summary

If the destination directory does not exist, exarch extract fails with:

Error: I/O error while processing 'archive.tar.gz': destination directory does not exist: /path/to/dest

Every major archive tool (tar, unzip, 7z, bsdtar) creates the destination directory automatically. Requiring it to exist in advance is a friction point and breaks common scripting patterns like:

exarch extract release.tar.gz ./dist/

Proposed behavior

If the destination directory does not exist, create it (including intermediate directories, equivalent to mkdir -p) before extraction begins. If creation fails, report the I/O error.

This matches the behavior of:

  • tar -xf archive.tar.gz -C ./dist/ (creates ./dist/ if absent)
  • unzip archive.zip -d ./dist/
  • 7z x archive.7z -o./dist/

Metadata

Metadata

Assignees

No one assigned

    Labels

    coreChanges to exarch-coreenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions