Skip to content

Commit fa39fd8

Browse files
committed
ENH: makes sure that all changes are commited and resets count of notebook cells
1 parent 52d6340 commit fa39fd8

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

update_gh-pages.sh

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
#!/bin/bash
22

3+
while true; do
4+
read -p "Did you submit all other changes and are you ready to update the pages? " yn
5+
case $yn in
6+
[Yy]* )
7+
8+
9+
10+
TIMESTAMP=`date +'%Y-%m-%d %H:%M:%S'`
11+
12+
# Reset the counts of all notebook cells
13+
for h in `find -name "*.ipynb"`
14+
do
15+
sed -i 's/^.*\execution_count\b.*$/ "execution_count": null,/' $h
16+
done
17+
git add *
18+
git commit -m "reset counts of all notebook cells - ${TIMESTAMP}"
19+
git push
20+
321
# Create a temporary folder
422
TMP_DIR=`mktemp -d`
523

@@ -46,7 +64,6 @@ do
4664
done
4765

4866
# Submit changes with current timestamp
49-
TIMESTAMP=`date +'%Y-%m-%d %H:%M:%S'`
5067
git add *
5168
git commit -a -m "Update gh-pages - ${TIMESTAMP}"
5269
git push origin gh-pages
@@ -56,3 +73,11 @@ rm -rf "$TMP_DIR"
5673

5774
# Go back to the master branch
5875
git checkout master
76+
77+
78+
79+
break;;
80+
[Nn]* ) exit;;
81+
* ) echo "Please answer yes or no.";;
82+
esac
83+
done

0 commit comments

Comments
 (0)