|
|
- #!/bin/bash
-
- if [ -f ".repo_initialized" ]; then
- echo "############################################################"
- echo "# This repo is already initialized!"
- echo "############################################################"
- else
- echo "############################################################"
- echo "# Update and initialize all submodules..."
- echo "############################################################"
- git submodule update --init --recursive
-
- if [ -f "README_PROJECT_TEMPLATE.md" ]; then
- echo "############################################################"
- echo "# First run after creation from template."
- echo "#"
- echo "# Have you copied the hardware description file and set"
- echo "# the path to it in 'tcl_scripts/platform_create.tcl?'"
- echo "#"
- echo "# If not, set it and rerun this script!"
- echo "############################################################"
- read -p "Press ENTER to continue or CTRL+C to abort..."
-
- rm -f README.md
- mv README_PROJECT_TEMPLATE.md README.md
-
- git add README.md README_PROJECT_TEMPLATE.md
- git commit -m "chore: from init_after_clone script: replace template readme"
-
- mv tcl_scripts/import_platform_and_projects.tcl tcl_scripts/import_platform_and_projects.tcl.gitsubstitute
- mv tcl_scripts/import_platform_only.tcl tcl_scripts/import_platform_only.tcl.gitsubstitute
- mv tcl_scripts/platform_create.tcl tcl_scripts/platform_create.tcl.gitsubstitute
-
- git add -f tcl_scripts/import_platform_and_projects.tcl tcl_scripts/import_platform_and_projects.tcl.gitsubstitute
- git add -f tcl_scripts/import_platform_only.tcl tcl_scripts/import_platform_only.tcl.gitsubstitute
- git add -f tcl_scripts/platform_create.tcl tcl_scripts/platform_create.tcl.gitsubstitute
- git commit -m "chore: from init_after_clone script: replace tcl scripts"
-
- git config --local core.hooksPath .githooks
-
- touch .repo_initialized
- echo "This file is checked by the 'init_after_clone' script." >> .repo_initialized
-
- source ./clean_and_recreate_all --no-prompt --import-hw-platform-only
- else
- git config --local core.hooksPath .githooks
-
- touch .repo_initialized
- echo "This file is checked by the 'init_after_clone' script." >> .repo_initialized
-
- source ./clean_and_recreate_all --no-prompt
- fi
- fi
|