Skip to content

Commit 607ae5e

Browse files
authored
Merge pull request #762 from pyiron/binder_dir
[nit] Keep binder dir clean
2 parents 12fb21e + 9f1971e commit 607ae5e

File tree

1 file changed

+19
-28
lines changed

1 file changed

+19
-28
lines changed

.binder/postBuild

Lines changed: 19 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,20 @@
1-
# pip install master
2-
pip install --no-deps .
3-
# Note: This produces build and pyiron_workflow.egg-info directories
1+
#!/bin/bash
2+
pip install . --no-deps --no-build-isolation
43

5-
# clean up
6-
if [ -d "notebooks" ]; then
7-
mv notebooks/* .
8-
fi
9-
if [ -d "${HOME}/pyiron_workflow" ]; then
10-
rm -r ${HOME}/.binder \
11-
${HOME}/.ci_support \
12-
${HOME}/.github \
13-
${HOME}/build \
14-
${HOME}/docs \
15-
${HOME}/notebooks \
16-
${HOME}/pyiron_workflow \
17-
${HOME}/pyiron_workflow.egg-info \
18-
${HOME}/tests \
19-
${HOME}/.gitattributes \
20-
${HOME}/.gitignore \
21-
${HOME}/.gitpod \
22-
${HOME}/.readthedocs.yml \
23-
${HOME}/CODE_OF_CONDUCT.md \
24-
${HOME}/CONTRIBUTING.rst \
25-
${HOME}/LICENSE \
26-
${HOME}/MANIFEST.in \
27-
${HOME}/pyproject.toml \
28-
${HOME}/setup.py
29-
fi
4+
# Save the stuff we actually need for binder
5+
KEEP=("notebooks")
6+
mkdir -p ${HOME}/.temp_keep
7+
for item in "${KEEP[@]}"; do
8+
[ -e "${HOME}/${item}" ] && mv "${HOME}/${item}" ${HOME}/.temp_keep/
9+
done
10+
11+
# Now clean up everything else
12+
find ${HOME} -mindepth 1 -maxdepth 1 ! -name '.temp_keep' -exec rm -rf {} +
13+
14+
# Restore the kept material
15+
mv ${HOME}/.temp_keep/* ${HOME}/
16+
rmdir ${HOME}/.temp_keep
17+
18+
# Manipulate kept material
19+
mv ${HOME}/notebooks/* ${HOME}
20+
rmdir ${HOME}/notebooks

0 commit comments

Comments
 (0)