Skip to content

Commit

Permalink
change shopify-dev links to relative
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesvidler committed Feb 1, 2024
1 parent ef1687a commit 2d691b6
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions packages/ui-extensions/docs/surfaces/checkout/build-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,26 +41,24 @@ if [ $sed_exit -ne 0 ]; then
fi

# Copy the generated docs to shopify-dev
if [ -d ~/src/github.com/Shopify/shopify-dev ]; then
mkdir -p ~/src/github.com/Shopify/shopify-dev/db/data/docs/templated_apis/checkout_extensions/$API_VERSION
cp ./$DOCS_PATH/generated/* ~/src/github.com/Shopify/shopify-dev/db/data/docs/templated_apis/checkout_extensions/$API_VERSION
if [ -d ../../../shopify-dev ]; then
mkdir -p ../../../shopify-dev/db/data/docs/templated_apis/checkout_extensions/$API_VERSION
cp ./$DOCS_PATH/generated/* ../../../shopify-dev/db/data/docs/templated_apis/checkout_extensions/$API_VERSION
# Replace 'unstable' with the exact API version in relative doc links
sed -i \
"s/\/docs\/api\/checkout-ui-extensions\/unstable/\/docs\/api\/checkout-ui-extensions\/$API_VERSION/gi" \
~/src/github.com/Shopify/shopify-dev/db/data/docs/templated_apis/checkout_extensions/$API_VERSION/generated_docs_data.json
../../../shopify-dev/db/data/docs/templated_apis/checkout_extensions/$API_VERSION/generated_docs_data.json
sed_exit=$?
if [ $sed_exit -ne 0 ]; then
fail_and_exit $sed_exit
fi
rsync -a --delete ./$DOCS_PATH/screenshots/ ~/src/github.com/Shopify/shopify-dev/app/assets/images/templated-apis-screenshots/checkout-ui-extensions/$API_VERSION

cd ~/src/github.com/Shopify/shopify-dev
rsync -a --delete ./$DOCS_PATH/screenshots/ ../../../shopify-dev/app/assets/images/templated-apis-screenshots/checkout-ui-extensions/$API_VERSION

if [ -n "$SPIN_SHOPIFY_DEV_SERVICE_FQDN" ]; then
echo "Docs: https://$SPIN_SHOPIFY_DEV_SERVICE_FQDN/docs/api/checkout-ui-extensions"
else
echo "If you include shopify-dev in your Spin constellation, we can generate a preview link for the docs!"
fi
else
echo "Not copying docs to shopify-dev because it was not found at ~/src/github.com/Shopify/shopify-dev."
echo "Not copying docs to shopify-dev because it was not found at ../../../shopify-dev."
fi

0 comments on commit 2d691b6

Please sign in to comment.