-
Notifications
You must be signed in to change notification settings - Fork 2
/
testing.sh
61 lines (56 loc) · 1.3 KB
/
testing.sh
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/env bash
show_help() {
echo "Usage: ./testing.sh <clean|render|move|open|help>"
echo " clean: Delete HTML files from the docs folder"
echo " render: Render example qmd files to HTML using quarto"
echo " move: Move HTML files to docs folder"
echo " open: Open HTML files from docs folder"
echo " help: Show this help message"
}
if [ $# -eq 0 ]; then
echo "Error: No argument provided."
show_help
exit 1
fi
argument="$1"
case "$argument" in
"clean")
echo "Deleting HTML files from docs folder"
rm -rf docs/*
;;
"render")
echo "Rendering qmd files using quarto"
quarto render example.qmd
;;
"move")
echo "Moving HTML files to docs folder"
mv *.html docs/
;;
"open")
echo "Opening HTML files from docs folder"
for html_file in docs/*.html; do
start "$html_file"
done
;;
"check_all")
echo "Deleting HTML files from docs folder"
rm -rf docs/*
echo "Rendering qmd files using quarto"
quarto render example.qmd
echo "Moving HTML files to docs folder"
mv *.html docs/
echo "Opening HTML files from docs folder"
for html_file in docs/*.html; do
start "$html_file"
done
;;
"help")
show_help
;;
*)
echo "Invalid argument: $argument"
show_help
exit 1
;;
esac
exit 0