diff --git a/notebooks/luke-scribe-colab.ipynb b/notebooks/luke-scribe-colab.ipynb index 7238c57..5b4bb35 100644 --- a/notebooks/luke-scribe-colab.ipynb +++ b/notebooks/luke-scribe-colab.ipynb @@ -40,7 +40,7 @@ "execution_count": null, "metadata": {}, "outputs": [], - "source": "# 1) 클론 (private 저장소면 GITEA_TOKEN 입력)\nGITEA_TOKEN = '' # ← 필요 시 입력: https://git.lukehemmin.com/user/settings/applications\n\nif GITEA_TOKEN:\n REPO = f'https://{GITEA_TOKEN}@git.lukehemmin.com/lukehemmin/luke_scribe.git'\nelse:\n REPO = 'https://git.lukehemmin.com/lukehemmin/luke_scribe.git'\n\n!rm -rf luke_scribe\n!git clone -b feat/full-platform {REPO}\nimport os\nos.chdir('/content/luke_scribe')\nprint('클론 완료 →', os.getcwd())\n!git log --oneline -1\n" + "source": "# 1) 클론 또는 업데이트 (private 저장소면 GITEA_TOKEN 입력)\nGITEA_TOKEN = '' # ← 필요 시 입력: https://git.lukehemmin.com/user/settings/applications\n\nif GITEA_TOKEN:\n REPO = f'https://{GITEA_TOKEN}@git.lukehemmin.com/lukehemmin/luke_scribe.git'\nelse:\n REPO = 'https://git.lukehemmin.com/lukehemmin/luke_scribe.git'\n\nimport os, subprocess\n\nif os.path.isdir('/content/luke_scribe/.git'):\n # 이미 클론된 레포 → 최신 브랜치로 갱신 (pull)\n print('기존 레포 감지 → pull로 갱신')\n subprocess.run(['git', 'fetch', 'origin'], cwd='/content/luke_scribe', check=True)\n subprocess.run(['git', 'checkout', 'feat/full-platform'], cwd='/content/luke_scribe', check=True)\n subprocess.run(['git', 'pull', '--ff-only', 'origin', 'feat/full-platform'], cwd='/content/luke_scribe', check=True)\nelse:\n # 최초 실행 → 클론\n subprocess.run(['git', 'clone', '-b', 'feat/full-platform', REPO], cwd='/content', check=True)\n\nos.chdir('/content/luke_scribe')\nprint('작업 디렉터리 →', os.getcwd())\n!git log --oneline -1\n" }, { "cell_type": "markdown", diff --git a/scripts/build_colab_notebook.py b/scripts/build_colab_notebook.py index 5c0fa03..3ac50ba 100644 --- a/scripts/build_colab_notebook.py +++ b/scripts/build_colab_notebook.py @@ -70,7 +70,7 @@ def cells() -> list[dict]: "저장소가 private이면 아래 셀의 `GITEA_TOKEN`에 토큰을 입력하세요." ), code( - "# 1) 클론 (private 저장소면 GITEA_TOKEN 입력)\n" + "# 1) 클론 또는 업데이트 (private 저장소면 GITEA_TOKEN 입력)\n" "GITEA_TOKEN = '' # ← 필요 시 입력: https://git.lukehemmin.com/user/settings/applications\n" "\n" "if GITEA_TOKEN:\n" @@ -78,11 +78,20 @@ def cells() -> list[dict]: "else:\n" " REPO = 'https://git.lukehemmin.com/lukehemmin/luke_scribe.git'\n" "\n" - "!rm -rf luke_scribe\n" - "!git clone -b feat/full-platform {REPO}\n" - "import os\n" + "import os, subprocess\n" + "\n" + "if os.path.isdir('/content/luke_scribe/.git'):\n" + " # 이미 클론된 레포 → 최신 브랜치로 갱신 (pull)\n" + " print('기존 레포 감지 → pull로 갱신')\n" + " subprocess.run(['git', 'fetch', 'origin'], cwd='/content/luke_scribe', check=True)\n" + " subprocess.run(['git', 'checkout', 'feat/full-platform'], cwd='/content/luke_scribe', check=True)\n" + " subprocess.run(['git', 'pull', '--ff-only', 'origin', 'feat/full-platform'], cwd='/content/luke_scribe', check=True)\n" + "else:\n" + " # 최초 실행 → 클론\n" + " subprocess.run(['git', 'clone', '-b', 'feat/full-platform', REPO], cwd='/content', check=True)\n" + "\n" "os.chdir('/content/luke_scribe')\n" - "print('클론 완료 →', os.getcwd())\n" + "print('작업 디렉터리 →', os.getcwd())\n" "!git log --oneline -1\n" ), md("## 2) 시스템 의존성 + 설치\n\nffmpeg(오디오 정규화) 설치 후 venv에 luke-scribe를 설치합니다."),