Elixir SDK for Pocketenv
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Document sandbox upload/download/copy APIs

+33
+33
README.md
··· 202 202 203 203 If VS Code is already exposed the existing URL is returned immediately. 204 204 205 + #### Copy 206 + 207 + Transfer files and directories between your local machine and a sandbox, or 208 + directly between two sandboxes. 209 + 210 + ```elixir 211 + # Upload a local directory to the sandbox 212 + :ok = sandbox |> Sandbox.upload("./my-project", "/workspace") 213 + 214 + # Upload a single file 215 + :ok = sandbox |> Sandbox.upload("./config.json", "/workspace") 216 + 217 + # Download a path from the sandbox to a local directory 218 + :ok = sandbox |> Sandbox.download("/workspace/output", "./output") 219 + 220 + # Copy a path from one sandbox to another (no local I/O) 221 + :ok = sandbox |> Sandbox.copy_to(other_sandbox.id, "/workspace", "/workspace") 222 + ``` 223 + 224 + `upload/4` respects `.pocketenvignore`, `.gitignore`, `.npmignore`, and 225 + `.dockerignore` files found anywhere under the source directory, so files 226 + like `node_modules/` and build artefacts are excluded automatically. 227 + 228 + | Function | Returns | Description | 229 + |---|---|---| 230 + | `Sandbox.upload(sandbox, local_path, sandbox_path, opts)` | `:ok` | Compress and upload a local file or directory to the sandbox | 231 + | `Sandbox.download(sandbox, sandbox_path, local_path, opts)` | `:ok` | Download a path from the sandbox and extract it locally | 232 + | `Sandbox.copy_to(sandbox, dest_id, src_path, dest_path, opts)` | `:ok` | Copy a path from this sandbox to another sandbox | 233 + 234 + The storage endpoint defaults to `https://sandbox.pocketenv.io` and can be 235 + overridden via the `:storage_url` app config key or the 236 + `POCKETENV_STORAGE_URL` environment variable. 237 + 205 238 --- 206 239 207 240 ## Types