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.

53 lines
2.4 KiB

  1. #!/bin/bash
  2. if [ -f ".repo_initialized" ]; then
  3. echo "############################################################"
  4. echo "# This repo is already initialized!"
  5. echo "############################################################"
  6. else
  7. echo "############################################################"
  8. echo "# Update and initialize all submodules..."
  9. echo "############################################################"
  10. git submodule update --init --recursive
  11. if [ -f "README_PROJECT_TEMPLATE.md" ]; then
  12. echo "############################################################"
  13. echo "# First run after creation from template."
  14. echo "#"
  15. echo "# Have you copied the hardware description file and set"
  16. echo "# the path to it in 'tcl_scripts/platform_create.tcl?'"
  17. echo "#"
  18. echo "# If not, set it and rerun this script!"
  19. echo "############################################################"
  20. read -p "Press ENTER to continue or CTRL+C to abort..."
  21. rm -f README.md
  22. mv README_PROJECT_TEMPLATE.md README.md
  23. git add README.md README_PROJECT_TEMPLATE.md
  24. git commit -m "chore: from init_after_clone script: replace template readme"
  25. mv tcl_scripts/import_platform_and_projects.tcl tcl_scripts/import_platform_and_projects.tcl.gitsubstitute
  26. mv tcl_scripts/import_platform_only.tcl tcl_scripts/import_platform_only.tcl.gitsubstitute
  27. mv tcl_scripts/platform_create.tcl tcl_scripts/platform_create.tcl.gitsubstitute
  28. git add -f tcl_scripts/import_platform_and_projects.tcl tcl_scripts/import_platform_and_projects.tcl.gitsubstitute
  29. git add -f tcl_scripts/import_platform_only.tcl tcl_scripts/import_platform_only.tcl.gitsubstitute
  30. git add -f tcl_scripts/platform_create.tcl tcl_scripts/platform_create.tcl.gitsubstitute
  31. git commit -m "chore: from init_after_clone script: replace tcl scripts"
  32. git config --local core.hooksPath .githooks
  33. touch .repo_initialized
  34. echo "This file is checked by the 'init_after_clone' script." >> .repo_initialized
  35. source ./clean_and_recreate_all --no-prompt --import-hw-platform-only
  36. else
  37. git config --local core.hooksPath .githooks
  38. touch .repo_initialized
  39. echo "This file is checked by the 'init_after_clone' script." >> .repo_initialized
  40. source ./clean_and_recreate_all --no-prompt
  41. fi
  42. fi