Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix an issue on rover login #263

Merged
merged 1 commit into from
Jun 9, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 17 additions & 15 deletions scripts/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -711,25 +711,27 @@ function deploy {
}

function checkout_module {
# Update submodule branch based on .gitmodules
cd ${landingzone_name}
base_folder=$(git rev-parse --show-toplevel)
if [ ! -z ${landingzone_name} ]; then
# Update submodule branch based on .gitmodules
cd ${landingzone_name}
base_folder=$(git rev-parse --show-toplevel)

if [ $? != 0 ]; then
error ${LINEO} "landingzone folder not setup properly. Fix and restart."
fi
if [ $? != 0 ]; then
error ${LINEO} "landingzone folder not setup properly. Fix and restart."
fi

if [ ! $(git config --global --get safe.directory | grep "${base_folder}" 2>&1) ]; then
git config --global --add safe.directory "${base_folder}"
fi
if [ ! $(git config --global --get safe.directory | grep "${base_folder}" 2>&1) ]; then
git config --global --add safe.directory "${base_folder}"
fi

if [ -f "${base_folder}/.gitmodules" ]; then
cd ${base_folder}
if [ ! $(git config --global --get safe.directory | grep "${base_folder}/aztfmod" 2>&1) ]; then
git config --global --add safe.directory "${base_folder}/aztfmod"
if [ -f "${base_folder}/.gitmodules" ]; then
cd ${base_folder}
if [ ! $(git config --global --get safe.directory | grep "${base_folder}/aztfmod" 2>&1) ]; then
git config --global --add safe.directory "${base_folder}/aztfmod"
fi
git submodule init 2>&1
git submodule update --remote --checkout 2>&1
fi
git submodule init 2>&1
git submodule update --remote --checkout 2>&1
fi
}

Expand Down