Open-source, secure environment with real-world tools for enterprise-grade agents.
Python agentaiai-agentai-agentscode-interpretercopilotdevelopmentdevtoolsgptgpt-4javascriptllmnextjsopenaipythonreactsoftwaretypescript
Fix CLI template migrate copy target (#915)
Jakub Dobryb43793ceb9e0
diff --git a/.changeset/thirty-birds-serve.md b/.changeset/thirty-birds-serve.mdnew file mode 100644index 000000000..18c3b7ffa--- /dev/null+++ b/.changeset/thirty-birds-serve.md@@ -0,0 +1,5 @@+---+'@e2b/cli': patch+---++fix template migrate copy target pathdiff --git a/packages/cli/src/commands/template/generators/handlebars.ts b/packages/cli/src/commands/template/generators/handlebars.tsindex b7a2ddf9d..ce1b18dcd 100644--- a/packages/cli/src/commands/template/generators/handlebars.ts+++ b/packages/cli/src/commands/template/generators/handlebars.ts@@ -72,7 +72,7 @@ export async function transformTemplateData(case 'COPY': {if (step.args.length >= 2) {const src = step.args[0]- let dest = step.args[step.args.length - 1]+ let dest = step.args[1]if (!dest || dest === '') {dest = '.'}diff --git a/packages/cli/tests/commands/template/fixtures/copy-variations/expected/python-async/template.py b/packages/cli/tests/commands/template/fixtures/copy-variations/expected/python-async/template.pyindex a590649b8..61e8fc604 100644--- a/packages/cli/tests/commands/template/fixtures/copy-variations/expected/python-async/template.py+++ b/packages/cli/tests/commands/template/fixtures/copy-variations/expected/python-async/template.py@@ -3,7 +3,7 @@ from e2b import AsyncTemplatetemplate = (AsyncTemplate().from_image("alpine:latest")- .copy("package.json", ".")- .copy("src/index.js", ".")- .copy("config.json", ".")+ .copy("package.json", "/app/")+ .copy("src/index.js", "./src/")+ .copy("config.json", "/etc/app/config.json"))\ No newline at end of filediff --git a/packages/cli/tests/commands/template/fixtures/copy-variations/expected/python-sync/template.py b/packages/cli/tests/commands/template/fixtures/copy-variations/expected/python-sync/template.pyindex c3fae6c00..83a3694c3 100644--- a/packages/cli/tests/commands/template/fixtures/copy-variations/expected/python-sync/template.py+++ b/packages/cli/tests/commands/template/fixtures/copy-variations/expected/python-sync/template.py@@ -3,7 +3,7 @@ from e2b import Templatetemplate = (Template().from_image("alpine:latest")- .copy("package.json", ".")- .copy("src/index.js", ".")- .copy("config.json", ".")+ .copy("package.json", "/app/")+ .copy("src/index.js", "./src/")+ .copy("config.json", "/etc/app/config.json"))\ No newline at end of filediff --git a/packages/cli/tests/commands/template/fixtures/copy-variations/expected/typescript/template.ts b/packages/cli/tests/commands/template/fixtures/copy-variations/expected/typescript/template.tsindex 53557e163..a4fffac47 100644--- a/packages/cli/tests/commands/template/fixtures/copy-variations/expected/typescript/template.ts+++ b/packages/cli/tests/commands/template/fixtures/copy-variations/expected/typescript/template.ts@@ -2,6 +2,6 @@ import { Template } from 'e2b'export const template = Template().fromImage('alpine:latest')- .copy('package.json', '.')- .copy('src/index.js', '.')- .copy('config.json', '.')\ No newline at end of file+ .copy('package.json', '/app/')+ .copy('src/index.js', './src/')+ .copy('config.json', '/etc/app/config.json')