|
import os |
|
import subprocess |
|
import argparse |
|
|
|
|
|
parser = argparse.ArgumentParser(description="This is a sample script.") |
|
|
|
|
|
|
|
parser.add_argument("--key", type=int, help="Your PAT", required=True) |
|
|
|
|
|
|
|
repo_url = "https://github.com/OzoneAsai/flashcards.git" |
|
|
|
if github_token: |
|
|
|
repo_url_with_token = repo_url.replace("https://", f"https://{github_token}@") |
|
|
|
try: |
|
|
|
subprocess.run(["git", "clone", repo_url_with_token], check=True) |
|
print("リポジトリのクローンが成功しました。") |
|
except subprocess.CalledProcessError as e: |
|
print(f"クローンに失敗しました: {e}") |
|
else: |
|
print("GitHubトークンが見つかりません。環境変数 'ghKey' または 'PAT' が設定されているか確認してください。") |
|
|