From 96c68f22f5603436b3548cc9e7858ee207a43e90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20D=C3=A9siles?= <1536672+jokesterfr@users.noreply.github.com> Date: Thu, 7 Dec 2023 17:58:55 +0100 Subject: [PATCH] Add more notes on what's going on there --- .../init-scripts/build-assets.sh | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/examples/develop-prestashop/init-scripts/build-assets.sh b/examples/develop-prestashop/init-scripts/build-assets.sh index caf98db..ac6089a 100755 --- a/examples/develop-prestashop/init-scripts/build-assets.sh +++ b/examples/develop-prestashop/init-scripts/build-assets.sh @@ -1,7 +1,21 @@ #!/bin/sh set -eu -echo "* Build PrestaShop assets..." +echo "* Download composer dependencies..." make composer + +echo "* Build PrestaShop assets..." +# Disclaimer: it seems that the PrestaShop front-end assets currently require +# to install Node.js dependencies globally. This is a bad pattern, which would +# require this script to be run as root. +# +# As an alternative, we propose this NPM_PREFIX_DIR hack suggestion, which could +# eventually help to avoid running init-scripts as root in the future +# +NPM_PREFIX_DIR=/tmp/npm +mkdir -p $NPM_PREFIX_DIR +npm prefix -g $NPM_PREFIX_DIR +export PATH="$PATH:$NPM_PREFIX_DIR/bin" make assets -echo "* Assets built!" + +echo "✅ Assets built!"