"examples/community/imagic_stable_diffusion.py" did not exist on "f7ebe56921f69c05a9273dae4755490a9c51ce12"
commit_docs.sh 929 Bytes
Newer Older
1
2
3
4
5
6
7
8
#!/usr/bin/env bash

set -ex


if [ "$2" == "" ]; then
    echo call as "$0" "<src>" "<target branch>"
    echo where src is the root of the built documentation git checkout and
9
    echo branch should be "main" or "1.7" or so
10
11
12
13
14
15
16
17
18
19
20
21
22
    exit 1
fi

src=$1
target=$2

echo "committing docs from ${src} to ${target}"

pushd "${src}"
git checkout gh-pages
mkdir -p ./"${target}"
rm -rf ./"${target}"/*
cp -r "${src}/docs/build/html/"* ./"$target"
23
if [ "${target}" == "main" ]; then
24
25
26
27
28
29
30
31
32
33
34
35
    mkdir -p ./_static
    rm -rf ./_static/*
    cp -r "${src}/docs/build/html/_static/"* ./_static
    git add --all ./_static || true
fi
git add --all ./"${target}" || true
git config user.email "soumith+bot@pytorch.org"
git config user.name "pytorchbot"
# If there aren't changes, don't make a commit; push is no-op
git commit -m "auto-generating sphinx docs" || true
git remote add https https://github.com/pytorch/vision.git
git push -u https gh-pages