|
2 | 2 |
|
3 | 3 | set -x |
4 | 4 |
|
5 | | -if [[ $2 ]] ; then |
6 | | - set +x |
7 | | - echo -e "You no longer need to set the version. Just do: ./release_docs $2" |
8 | | - exit 1 |
| 5 | +# Note: $2 will now be interpreted as a 'do not commit' flag - SLB doesn't |
| 6 | +# use the final commiting logic since she needs to push to upstream not |
| 7 | +# origin and also does some checks |
| 8 | +if [[ -n $2 && $2 != "no-commit" ]]; then |
| 9 | + set +x |
| 10 | + echo "Error: second argument can only be 'no-commit'" >&2 |
| 11 | + exit 1 |
9 | 12 | fi |
10 | 13 |
|
11 | 14 | version=`python -c "import cf; print(cf.__version__)"` |
|
181 | 184 | # -------------------------------------------------------------------- |
182 | 185 | # Process styles and templates |
183 | 186 | # -------------------------------------------------------------------- |
184 | | -# Copy over our custom stylesheet. It is referenced in the HTML docs |
185 | | -# files but Sphinx with alabaster theme doesn't seem to (?) provide a |
186 | | -# means to transfer it to the created _static dir via the build itself |
187 | | -# *when* the output dir is the top-level one (hence copy works for |
188 | | -# 'dev' & 'archive' builds to sub-dirs). Seemingly relates to the |
189 | | -# build warning: |
190 | | -# WARNING: html_static_path entry '_static' is placed inside outdir |
| 187 | + |
191 | 188 | if [[ $1 = "latest" ]] ; then |
| 189 | + # Copy over our custom stylesheet. It is referenced in the HTML docs |
| 190 | + # files but Sphinx with alabaster theme doesn't seem to (?) provide a |
| 191 | + # means to transfer it to the created _static dir via the build itself |
| 192 | + # *when* the output dir is the top-level one (hence copy works for |
| 193 | + # 'dev' & 'archive' builds to sub-dirs). Seemingly relates to the |
| 194 | + # build warning: |
| 195 | + # WARNING: html_static_path entry '_static' is placed inside outdir |
192 | 196 | cp source/_static/customise-alabaster.css _static/customise-alabaster.css |
193 | | -fi |
194 | | - |
195 | | -# Copy the templates to the target directory |
196 | | -if [[ $1 != "latest" ]] ; then |
| 197 | +else |
| 198 | + # For all other cases, copy the templates to the target directory |
197 | 199 | rm -fr $dir/_templates |
198 | 200 | cp -pr _templates $dir |
199 | 201 | fi |
200 | 202 |
|
201 | 203 | # -------------------------------------------------------------------- |
202 | 204 | # Add and commit the latest |
203 | 205 | # -------------------------------------------------------------------- |
204 | | -if [[ $1 = "Xlatest" ]] ; then |
| 206 | +if [[ $1 = "latest" && $2 != "no-commit" ]] ; then |
205 | 207 | cd $dir |
206 | 208 | git add \ |
207 | 209 | *.html \ |
|
0 commit comments