Skip to content

Commit

Permalink
Merge pull request #263 from aztfmod/patch.login
Browse files Browse the repository at this point in the history
Fix an issue on rover login
  • Loading branch information
arnaudlh authored Jun 9, 2022
2 parents b2d4342 + 917b043 commit 28f3e85
Showing 1 changed file with 17 additions and 15 deletions.
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

0 comments on commit 28f3e85

Please sign in to comment.