#!/usr/bin/env python3

import os
import shutil
import subprocess

TARGET = ".docs"
VERSION = "clang_9_0"

if os.path.isdir(TARGET):
    shutil.rmtree(TARGET)

os.mkdir(TARGET)

for (name, features) in [("default", VERSION), ("runtime", f"runtime,{VERSION}")]:
    subprocess.call(["cargo", "clean"])
    subprocess.call(["cargo", "doc", f"--features={features}", "--no-deps"])
    print(f"Copying docs to {TARGET}/{name}...")
    shutil.copytree(f"target/doc", f"{TARGET}/{name}")

os.chdir(TARGET)
subprocess.call(["git", "init"])
subprocess.call(["git", "remote", "add", "origin", "git@github.com:KyleMayes/clang-sys.git"])
subprocess.call(["git", "checkout", "--orphan", "gh-pages"])
subprocess.call(["git", "add", "-A"])
subprocess.call(["git", "commit", "-m", "\"Update documentation\""])
subprocess.call(["git", "push", "origin", "gh-pages", "--force"])

os.chdir("..")
shutil.rmtree(TARGET)

500340660b5f235856bf89fe37cda909fab9d15f
<mask token>

<mask token>
if os.path.isdir(TARGET):
    shutil.rmtree(TARGET)
os.mkdir(TARGET)
for name, features in [('default', VERSION), ('runtime', f'runtime,{VERSION}')
    ]:
    subprocess.call(['cargo', 'clean'])
    subprocess.call(['cargo', 'doc', f'--features={features}', '--no-deps'])
    print(f'Copying docs to {TARGET}/{name}...')
    shutil.copytree(f'target/doc', f'{TARGET}/{name}')
os.chdir(TARGET)
subprocess.call(['git', 'init'])
subprocess.call(['git', 'remote', 'add', 'origin',
    'git@github.com:KyleMayes/clang-sys.git'])
subprocess.call(['git', 'checkout', '--orphan', 'gh-pages'])
subprocess.call(['git', 'add', '-A'])
subprocess.call(['git', 'commit', '-m', '"Update documentation"'])
subprocess.call(['git', 'push', 'origin', 'gh-pages', '--force'])
os.chdir('..')
shutil.rmtree(TARGET)

<mask token>
TARGET = '.docs'
VERSION = 'clang_9_0'
if os.path.isdir(TARGET):
    shutil.rmtree(TARGET)
os.mkdir(TARGET)
for name, features in [('default', VERSION), ('runtime', f'runtime,{VERSION}')
    ]:
    subprocess.call(['cargo', 'clean'])
    subprocess.call(['cargo', 'doc', f'--features={features}', '--no-deps'])
    print(f'Copying docs to {TARGET}/{name}...')
    shutil.copytree(f'target/doc', f'{TARGET}/{name}')
os.chdir(TARGET)
subprocess.call(['git', 'init'])
subprocess.call(['git', 'remote', 'add', 'origin',
    'git@github.com:KyleMayes/clang-sys.git'])
subprocess.call(['git', 'checkout', '--orphan', 'gh-pages'])
subprocess.call(['git', 'add', '-A'])
subprocess.call(['git', 'commit', '-m', '"Update documentation"'])
subprocess.call(['git', 'push', 'origin', 'gh-pages', '--force'])
os.chdir('..')
shutil.rmtree(TARGET)

import os
import shutil
import subprocess
TARGET = '.docs'
VERSION = 'clang_9_0'
if os.path.isdir(TARGET):
    shutil.rmtree(TARGET)
os.mkdir(TARGET)
for name, features in [('default', VERSION), ('runtime', f'runtime,{VERSION}')
    ]:
    subprocess.call(['cargo', 'clean'])
    subprocess.call(['cargo', 'doc', f'--features={features}', '--no-deps'])
    print(f'Copying docs to {TARGET}/{name}...')
    shutil.copytree(f'target/doc', f'{TARGET}/{name}')
os.chdir(TARGET)
subprocess.call(['git', 'init'])
subprocess.call(['git', 'remote', 'add', 'origin',
    'git@github.com:KyleMayes/clang-sys.git'])
subprocess.call(['git', 'checkout', '--orphan', 'gh-pages'])
subprocess.call(['git', 'add', '-A'])
subprocess.call(['git', 'commit', '-m', '"Update documentation"'])
subprocess.call(['git', 'push', 'origin', 'gh-pages', '--force'])
os.chdir('..')
shutil.rmtree(TARGET)

#!/usr/bin/env python3

import os
import shutil
import subprocess

TARGET = ".docs"
VERSION = "clang_9_0"

if os.path.isdir(TARGET):
    shutil.rmtree(TARGET)

os.mkdir(TARGET)

for (name, features) in [("default", VERSION), ("runtime", f"runtime,{VERSION}")]:
    subprocess.call(["cargo", "clean"])
    subprocess.call(["cargo", "doc", f"--features={features}", "--no-deps"])
    print(f"Copying docs to {TARGET}/{name}...")
    shutil.copytree(f"target/doc", f"{TARGET}/{name}")

os.chdir(TARGET)
subprocess.call(["git", "init"])
subprocess.call(["git", "remote", "add", "origin", "git@github.com:KyleMayes/clang-sys.git"])
subprocess.call(["git", "checkout", "--orphan", "gh-pages"])
subprocess.call(["git", "add", "-A"])
subprocess.call(["git", "commit", "-m", "\"Update documentation\""])
subprocess.call(["git", "push", "origin", "gh-pages", "--force"])

os.chdir("..")
shutil.rmtree(TARGET)
