Skip to content

Script fs capability: add remove, mkdir, readFile, exists; frame-to-text helper #73

Description

@kitlangton

Drive 2.0.0 (464f9a3).

defineScript's fs exposes only writeFile. Removing a runtime-added plugin directory in plugin-registry.ts had to reach for node:fs/promises with a hand-built ${artifacts}/files/... path, which bypasses the project abstraction and will break if the files root ever moves.

Wish list, all relative to the project files root:

  • fs.remove(path, { recursive? })
  • fs.mkdir(path)
  • fs.readFile(path)
  • fs.exists(path)

A frame-to-text helper would also save every probe from re-deriving frame.lines.map(l => l.spans.map(s => s.text).join("")) when printing a screen on failure; ui.text() or a Frame.text(frame) export would do.

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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions