Skip to content

Commit 1b3b395

Browse files
Update release_docs to include optional no-commit flag
1 parent da808a7 commit 1b3b395

1 file changed

Lines changed: 18 additions & 16 deletions

File tree

release_docs

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22

33
set -x
44

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
912
fi
1013

1114
version=`python -c "import cf; print(cf.__version__)"`
@@ -181,27 +184,26 @@ fi
181184
# --------------------------------------------------------------------
182185
# Process styles and templates
183186
# --------------------------------------------------------------------
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+
191188
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
192196
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
197199
rm -fr $dir/_templates
198200
cp -pr _templates $dir
199201
fi
200202

201203
# --------------------------------------------------------------------
202204
# Add and commit the latest
203205
# --------------------------------------------------------------------
204-
if [[ $1 = "Xlatest" ]] ; then
206+
if [[ $1 = "latest" && $2 != "no-commit" ]] ; then
205207
cd $dir
206208
git add \
207209
*.html \

0 commit comments

Comments
 (0)