@@ -101,12 +101,16 @@ import "dotenv/config";
101101import { template } from " ./template" ;
102102import { Template } from " e2b" ;
103103
104- Template .build (template , {
105- alias: " template-tag-dev" ,
106- cpuCount: 1 ,
107- memoryMB: 1024 ,
108- onBuildLogs : (logEntry ) => console .log (logEntry .toString ()),
109- });
104+ async function main() {
105+ await Template .build (template , {
106+ alias: " template-tag-dev" ,
107+ cpuCount: 1 ,
108+ memoryMB: 1024 ,
109+ onBuildLogs : (logEntry ) => console .log (logEntry .toString ()),
110+ });
111+ }
112+
113+ main ().catch (console .error );
110114```
111115
112116``` python build_dev.py
@@ -116,13 +120,14 @@ from template import template
116120
117121load_dotenv()
118122
119- Template.build(
120- template,
121- alias = " template-tag-dev" ,
122- cpu_count = 1 ,
123- memory_mb = 1024 ,
124- on_build_logs = lambda log_entry : print (log_entry),
125- )
123+ if __name__ == ' __main__' :
124+ Template.build(
125+ template,
126+ alias = " template-tag-dev" ,
127+ cpu_count = 1 ,
128+ memory_mb = 1024 ,
129+ on_build_logs = lambda log_entry : print (log_entry),
130+ )
126131```
127132
128133</CodeGroup >
@@ -150,12 +155,16 @@ import "dotenv/config";
150155import { template } from " ./template" ;
151156import { Template } from " e2b" ;
152157
153- Template .build (template , {
154- alias: " template-tag" ,
155- cpuCount: 1 ,
156- memoryMB: 1024 ,
157- onBuildLogs : (logEntry ) => console .log (logEntry .toString ()),
158- });
158+ async function main() {
159+ await Template .build (template , {
160+ alias: " template-tag" ,
161+ cpuCount: 1 ,
162+ memoryMB: 1024 ,
163+ onBuildLogs : (logEntry ) => console .log (logEntry .toString ()),
164+ });
165+ }
166+
167+ main ().catch (console .error );
159168```
160169
161170``` python build_prod.py
@@ -165,13 +174,14 @@ from template import template
165174
166175load_dotenv()
167176
168- Template.build(
169- template,
170- alias = " template-tag" ,
171- cpu_count = 1 ,
172- memory_mb = 1024 ,
173- on_build_logs = lambda log_entry : print (log_entry),
174- )
177+ if __name__ == ' __main__' :
178+ Template.build(
179+ template,
180+ alias = " template-tag" ,
181+ cpu_count = 1 ,
182+ memory_mb = 1024 ,
183+ on_build_logs = lambda log_entry : print (log_entry),
184+ )
175185```
176186
177187</CodeGroup >
0 commit comments