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.

57 lines
2.6 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?"
  16. echo "#"
  17. echo "# Have you copied all relevant drivers?"
  18. echo "#"
  19. echo "# Have you set all necessary paths and options in"
  20. echo "# the 'tcl_scripts/platform_create.tcl' script?"
  21. echo "#"
  22. echo "# If not, copy and/or set it and re-run this script!"
  23. echo "############################################################"
  24. read -p "Press ENTER to continue or CTRL+C to abort..."
  25. rm -f README.md
  26. mv README_PROJECT_TEMPLATE.md README.md
  27. git add README.md README_PROJECT_TEMPLATE.md
  28. git commit -m "chore: from init_after_clone script: replace template readme"
  29. mv tcl_scripts/import_platform_and_projects.tcl tcl_scripts/import_platform_and_projects.tcl.gitsubstitute
  30. mv tcl_scripts/import_platform_only.tcl tcl_scripts/import_platform_only.tcl.gitsubstitute
  31. mv tcl_scripts/platform_create.tcl tcl_scripts/platform_create.tcl.gitsubstitute
  32. git add -f tcl_scripts/import_platform_and_projects.tcl tcl_scripts/import_platform_and_projects.tcl.gitsubstitute
  33. git add -f tcl_scripts/import_platform_only.tcl tcl_scripts/import_platform_only.tcl.gitsubstitute
  34. git add -f tcl_scripts/platform_create.tcl tcl_scripts/platform_create.tcl.gitsubstitute
  35. git commit -m "chore: from init_after_clone script: replace tcl scripts"
  36. git config --local core.hooksPath .githooks
  37. touch .repo_initialized
  38. echo "This file is checked by the 'init_after_clone' script." >> .repo_initialized
  39. source ./clean_and_recreate_all --no-prompt --import-hw-platform-only
  40. else
  41. git config --local core.hooksPath .githooks
  42. touch .repo_initialized
  43. echo "This file is checked by the 'init_after_clone' script." >> .repo_initialized
  44. source ./clean_and_recreate_all --no-prompt
  45. fi
  46. fi