Skip to content

safe-bash mkdir -p skips materializing implicit directories #728

Description

@kamilio

In safe-bash 0.1.555, the built-in mkdir returns immediately when -p finds an existing directory. For filesystems advertising implicitDirectories, that directory can exist only through descendants, so this skips the filesystem's recursive mkdir operation that persists explicit directory metadata.

Reproduction against Poe's real entity/store filesystem:

  1. Write /reports/drafts/note (implicit parents).
  2. Run mkdir -p /reports/drafts (success).
  3. Run rm /reports/drafts/note.
  4. test -d /reports/drafts incorrectly exits 1. Standard Bash preserves the directory.

The adapter's mkdir(path, {recursive: true}) already materializes these parents. The short circuit is in dist/safe-bash/commands/filesystem.js, createDirectory, before any adapter call; prepareDirectory is not used here. Please let implicit-directory filesystems materialize existing directories for mkdir -p while retaining standard errors, modes and verbose behavior. No custom command replacement is being added in Poe.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions