Skip to content

[feat] add support for pre and post scripts #3746

@nickfrosty

Description

@nickfrosty

when performing common tasks with the anchor CLI (like building a program), it would improve devex if the cli support pre and post commands. this idea already exists in the npm world (see npm docs here)

recommend support generic pre and post prefixes on any of the Anchor.toml scripts to enable devs to not have to manually run additional commands after completion of various tasks: they can be run automatically

example use case generate a Codama client:

  • Anchor.toml has a prebuild script declared that runs the Codama CLI to generate the JS/Rust client
  • a dev runs anchor build:
    1. the anchor cli should checks for prebuild => if found, run it
    2. the anchor cli executes the normal build logic
    3. the anchor cli should checks for postbuild => if found, run it

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions