Skip to content

adding a walk_dir method to loop over sql script inside sub folders #616

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

Closed
wants to merge 1 commit into from
Closed
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
14 changes: 13 additions & 1 deletion 8.0/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ _main() {
mysql_note "Temporary server started."

docker_setup_db
docker_process_init_files /docker-entrypoint-initdb.d/*
walk_dir "/docker-entrypoint-initdb.d/"

mysql_expire_root_user

Expand All @@ -363,6 +363,18 @@ _main() {
exec "$@"
}

walk_dir(){
for f in "$1"/*; do
plugin=$(basename $f)
[[ $plugin =~ ^(mysql-docker-entrypoint.sh)$ ]] && continue
if [[ -d "$f" ]]; then
walk_dir "$f"
else
docker_process_init_files "$f" "${mysql[@]}"
fi
done
}

# If we are sourced from elsewhere, don't perform any further actions
if ! _is_sourced; then
_main "$@"
Expand Down