diff --git a/entrypoint.sh b/entrypoint.sh
index 6d26963..f5304ad 100644
--- a/entrypoint.sh
+++ b/entrypoint.sh
@@ -44,25 +44,26 @@ cat jsdoc.json
echo "Generating documentation"
jsdoc -r $JSDOC_INPUT_FILES -c jsdoc.json -d "$DOCS_DIRECTORY"
+echo "Loading index_manager and grabbing path to first html file"
+source index_manager.sh
+FIRST_HTML_FILE=$(find_first_html_file "$DOCS_DIRECTORY")
+
echo "Copying documentation to destination git repository"
ls -la "$DOCS_DIRECTORY"
cp -ra "$DOCS_DIRECTORY"/. "$CLONE_DIR"
-echo "Copying templates and index_manager to destination git repository"
+echo "Copying templates to destination git repository"
cp -ra templates/. "$CLONE_DIR"
-cp -ra index_manager.sh "$CLONE_DIR"
echo "Changing directory to destination git repository"
cd "$CLONE_DIR"
echo "Generating or updating index.html"
-source index_manager.sh
create_index_html "."
-update_index_html "index.html" "
$GITHUB_REF"
+update_index_html "index.html" "$FIRST_HTML_FILE"
-echo "Deleting templates and index_manager from destination git repository"
+echo "Deleting templates from destination git repository"
rm -rf templates
-rm index_manager.sh
echo "Files that will be pushed:"
ls -la
diff --git a/index_manager.sh b/index_manager.sh
index faf2730..f657b76 100644
--- a/index_manager.sh
+++ b/index_manager.sh
@@ -1,5 +1,10 @@
#!/bin/sh -l
+# This script gets the folder and version output of the package's generated docs from jsdoc output
+find_first_html_file () {
+ find "$1" -name '*.html' | head -n 1
+}
+
# This script will add a new line of HTML to the index.html file
# The new line of HTML will be added after the line that contains the comment
update_index_html () {
@@ -23,5 +28,6 @@ create_index_html () {
fi
}
+export find_first_html_file
export create_index_html
export update_html_version
\ No newline at end of file