Skip to content

Commit 654735c

Browse files
committed
DOC: simplify API for gh-pages script
Given we're always uploading to github, just specify the project directory, optionally the organization.
1 parent 48ce28f commit 654735c

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ HTML_DIR=build/html
33
LATEX_DIR=build/latex
44
WWW_DIR=build/website
55
DOCSRC_DIR=doc
6-
GITHUB_REPO=https://github.com/nipy/nibabel
6+
PROJECT=nibabel
77
#
88
# The Python executable to be used
99
#
@@ -137,7 +137,7 @@ website-stamp: $(WWW_DIR) html-stamp pdf-stamp
137137
touch $@
138138

139139
upload-html: html-stamp
140-
./tools/upload-gh-pages.sh $(WWW_DIR) $(GITHUB_REPO)
140+
./tools/upload-gh-pages.sh $(WWW_DIR) $(PROJECT)
141141

142142
#
143143
# Sources

tools/upload-gh-pages.sh

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
#!/bin/bash
22
# Upload website to gh-pages
3+
USAGE="$0 <html_dir> <project-name> [<organization-name>]"
34
HTML_DIR=$1
45
if [ -z "$HTML_DIR" ]; then
5-
echo "Need to specify build directory"
6+
echo $USAGE
67
exit 1
78
fi
8-
UPSTREAM_REPO=$2
9-
if [ -z "$UPSTREAM_REPO" ]; then
10-
echo "Need to specify upstream repo"
9+
PROJECT=$2
10+
if [ -z "$PROJECT" ]; then
11+
echo $USAGE
1112
exit 1
1213
fi
14+
ORGANIZATION=$3
15+
if [ -z "$ORGANIZATION" ]; then
16+
ORGANIZATION=nipy
17+
fi
18+
upstream_repo="https://github.com/$ORGANIZATION/$PROJECT"
1319
cd $HTML_DIR
1420
git init
1521
git checkout -b gh-pages
@@ -18,6 +24,6 @@ git add *
1824
touch .nojekyll
1925
git add .nojekyll
2026
git commit -a -m "Documentation build - no history"
21-
git remote add origin $UPSTREAM_REPO
27+
git remote add origin $upstream_repo
2228
git push origin gh-pages --force
2329
rm -rf .git # Yes

0 commit comments

Comments
 (0)