openfree commited on
Commit
cbc89c5
·
verified ·
1 Parent(s): 93bf53d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -14
app.py CHANGED
@@ -34,21 +34,22 @@ def get_logs():
34
 
35
  import re
36
 
37
- def get_deployment_update(code):
38
- clean_code = remove_code_block(code)
39
- result = deploy_to_vercel(clean_code)
40
- # 배포 URL 추출
41
- match = re.search(r'https?://[\\w\\-]+\\.vercel\\.app', result)
42
- if match:
43
- url = match.group(0)
44
- # HTML 앵커로 링크 표시
45
- return gr.update(
46
- value=f'<a href="{url}" target="_blank">🚀 배포된 앱 열기:{url}</a>',
47
- visible=True
48
  )
49
- return gr.update(
50
- value=f'❌ 배포 URL을 찾을 수 없습니다.<br>결과: {html.escape(result)}',
51
- visible=True
 
52
  )
53
 
54
 
 
34
 
35
  import re
36
 
37
+ # app.py ― get_deployment_update만 교체
38
+ def get_deployment_update(code_md: str):
39
+ clean = remove_code_block(code_md)
40
+ result = deploy_to_vercel(clean)
41
+
42
+ m = re.search(r"https?://[\\w-]+\\.vercel\\.app", result)
43
+ if m: # 성공
44
+ url = m.group(0)
45
+ return (
46
+ f"<div class='deploy-success'>✅ 배포 완료!<br>"
47
+ f"<a href='{url}' target='_blank'>{url}</a></div>"
48
  )
49
+ # 실패
50
+ safe = html.escape(result)
51
+ return (
52
+ f"<div class='deploy-error'>❌ 배포 실패<br>{safe}</div>"
53
  )
54
 
55