You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
935 B

  1. #!/bin/bash
  2. # Init hugo config file
  3. python init_hugo_toml.py
  4. # Start Hugo server in the background. This will import/update Lotusdocs module.
  5. # The import of the module is important to get the themes files, because some of
  6. # the sub-directories must be adapted to the future doc structure.
  7. hugo server > init_hugo.log 2>&1 &
  8. # Wait for the end of the initialization process and stop hugo
  9. while true; do
  10. if grep -q "Web Server is available" init_hugo.log; then
  11. # Initialization done
  12. echo "Initialization complete. Web Server is available."
  13. # Get the PID of the Hugo process and store it in a file for later use
  14. pgrep -f "hugo server" | kill
  15. # You can stop the loop if you don't need to monitor the log anymore
  16. break
  17. fi
  18. sleep 1
  19. done
  20. # We don't need init_hugo.log anymore
  21. rm init_hugo.log
  22. # Generate Hugo Lotusdoc website structure and config
  23. python generate_lotusdocs.py