Skip to content

Commit ef21cfb

Browse files
committed
ci: improve script for generation of documentation (#1303)
Closes #1303 Signed-off-by: Pierre-Yves Lapersonne <pierreyves.lapersonne@orange.com>
1 parent 19f7de8 commit ef21cfb

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

scripts/generateWebDocumentation.sh

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ _() {
7878
fi
7979
}
8080

81+
clean_directory() {
82+
if [ -d "$$1" ]; then rm -rf "$1"; fi
83+
}
84+
8185
clean_repo() {
8286
_ "🧹 Cleaning Git repository"
8387
git reset --hard
@@ -263,16 +267,16 @@ if [[ $use_git -eq 1 ]]; then
263267
# Supposing all assets are in the branch in root level (/)
264268
# Do not remove .ico and .sg files ; keep the ones already existing in the branch
265269
# Do not remove theme-settings.json
266-
rm -rf "css"
267-
rm -rf "data"
268-
rm -rf "documentation"
269-
rm -rf "images"
270-
rm -rf "img"
271-
rm -rf "index"
272-
rm -rf "js"
273-
rm -rf "*.jpg"
274-
rm -rf "*.html"
275-
rm -rf "CNAME"
270+
clean_directory "css"
271+
clean_directory "data"
272+
clean_directory "documentation"
273+
clean_directory "images"
274+
clean_directory "img"
275+
clean_directory "index"
276+
clean_directory "js"
277+
clean_directory "*.jpg"
278+
clean_directory ".html"
279+
clean_directory "CNAME"
276280

277281
# Copy all files from temporary folder to branch
278282
cp -r "$DOCUMENTATION_HTML_LOCATION"/* "$DOCS_DIRECTORY"

0 commit comments

Comments
 (0)