2023-08-22 10:32:05 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
|
|
|
|
|
|
# Empty the site to remove unused pages and posts created by WP and Woo.
|
|
|
|
wp site empty --yes
|
|
|
|
|
|
|
|
# Attributes must be created before importing products.
|
|
|
|
bash $script_dir/attributes.sh
|
|
|
|
|
2023-12-22 08:33:18 +00:00
|
|
|
# Products must be created before anything else so the ids are deterministic.
|
|
|
|
bash $script_dir/products.sh
|
|
|
|
|
|
|
|
# Run all scripts in parallel at maximum 10 at a time.
|
2023-08-22 10:32:05 +00:00
|
|
|
find $script_dir/parallel/*.sh -maxdepth 1 -type f | xargs -P10 -n1 bash
|
|
|
|
|
2023-12-22 08:33:18 +00:00
|
|
|
# Run rewrite script last to ensure all posts are created before running it.
|
2023-08-22 10:32:05 +00:00
|
|
|
bash $script_dir/rewrite.sh
|