forked from linogaliana/python-datascientist
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·39 lines (31 loc) · 894 Bytes
/
Copy pathtest.sh
File metadata and controls
executable file
·39 lines (31 loc) · 894 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
# Test automatique des notebooks
#args=("$@")
cd "./temp"
echo "Jupytext ------------------"
#correction=${args[0]}
#extension=${args[1]}
correction=false
extension="Rmd"
echo "Correction: $correction"
echo "extension: $extension"
if [ "$correction" = true ] ; then
# CONVERT INTO NOTEBOOKS AND EXECUTE
for i in $(find . -type f \( -iname "*.md" -o -iname "*.Rmd" \)); do
echo "Executing $i"
jupytext --to py --execute "$i"
done
else
# Ici :
# * $extension = "md" -> enonces
# * $extension = "Rmd" -> corrections
for i in $(find . -type f \( -iname "*.md" -o -iname "*.Rmd" \)); do
echo "Converting $i"
# jupytext --to py --execute "$i"
jupytext --to ipynb "$i"
#jupyter nbconvert --to notebook --execute --inplace ${i/$extension/ipynb}
done
fi
for i in $(find . -type f \( -iname "*.md" -o -iname "*.Rmd" \)); do
rm "$i"
done