Skip to content

Proposal: cwd support to sandbox class #16

@tlgimenes

Description

@tlgimenes

Hi folks,

I'm building an online bundler. The idea is that I'll spin a container to write files, npm install and bundle.

Currently, I'm creating a new folder for each build with the following code

const sandbox = getSandbox(c.SANDBOX, 'my-sandbox')

// copy files with sanbox.writeFile

// install deps and build
await sandbox.exec('bun', ['install', --cwd, "path/to/the/build/folder"])
await sandbox.exec('bun', ['build', --cwd, 'path/to/the/build/folder'])

This works great, however, I need to, somehow, have a way to cwd to a given folder for building so I can remove this --cwd to the bun command.

Is this the intended usage? Should I spin one container for each build instead or this folder approach is ok?

thanks!

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