Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects

Draft: Resolve "fix: export all don't export projects"

Open Christophe Chaudier requested to merge 39-fix-export-all-don-t-export-projects into master
1 file
+ 18
4
Compare changes
  • Side-by-side
  • Inline
+ 18
4
@@ -581,19 +581,27 @@ _report_all() {
cd "${import_tmp_dir}" || _fail "Can't move to ${import_tmp_dir}"
done
done
echo "Check users :"
while IFS= read -r line; do
username="$(echo "${line}" | cut -d ";" -f 1)"
public_email="$(echo "${line}" | cut -d ";" -f 2)"
if ! _check_user_exist "${username}"; then
echo "${username};user don't exist" >> "${report_file}"
dest_username=$(_get_user_with_public_email "${public_email}")
if [[ -z ${dest_username} ]]; then
echo "${username};user don't exist" >> "${report_file}"
else
echo "${username};user exist with the same source public_email but with the name ${dest_username}" >> "${report_file}"
fi
elif ! _check_user_public_email "${username}" "${public_email}"; then
echo "${username};as not the source public_email : ${public_email}" >> "${report_file}"
dest_username=$(_get_user_with_public_email "${public_email}")
if [[ -z ${dest_username} ]]; then
echo "${username};exist but do not have the source public_email : ${public_email}" >> "${report_file}"
else
echo "${username};user exist with the same source public_email but with the name ${dest_username}" >> "${report_file}"
fi
fi
done < <(sort -u < "${report_tmp_file}")
fi
echo "----------------------[ Users report ]----------------------"
cat "${report_file}"
echo "------------------------------------------------------"
@@ -656,6 +664,12 @@ _check_user_exist() {
test "$(_api GET "users?username=${username_to_check}" | jq -r '.[].id')"
}
_get_user_with_public_email() {
local public_email_to_search=${1}
_api GET "users?search=${public_email_to_search}" | jq -r '.[].username'
}
# ---[ Main ]---
_main() {
Loading