Skip to content

Commit

Permalink
publish.sh: use a subshell to restore the cwd. Also, do the final stu…
Browse files Browse the repository at this point in the history
…ff even if revision is a sha
  • Loading branch information
Fergal Daly committed May 23, 2019
1 parent b556f83 commit c7e1a3d
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,24 @@ git checkout gh-pages
sha=$(git show --oneline --no-abbrev -s "$revision" | cut -f 1 -d " ")
dest=versions/"$sha"
git clone -s -n . "$dest"
cd "$dest"
git checkout "$sha"
echo Deleting `pwd`/.git
read f
rm -rf .git
git add .
git commit -a -m"Add gh-pages revision $sha"

if [ "$sha" = "$revision" ]; then
exit
fi

cd ..
ln -sfT "$sha" "$revision"
git add "$revision"
git commit -a -m"Update $revision->$sha"
(
cd "$dest"
git checkout "$sha"
echo Deleting `pwd`/.git
read f
rm -rf .git
git add .
git commit -a -m"Add gh-pages revision $sha"

if [ "$sha" = "$revision" ]; then
exit
fi

cd ..
ln -sfT "$sha" "$revision"
git add "$revision"
git commit -a -m"Update $revision->$sha"
)
git push

git checkout -
Expand Down

0 comments on commit c7e1a3d

Please sign in to comment.