Skip to content

Commit

Permalink
feat: check if src or components directory exists before compiling th…
Browse files Browse the repository at this point in the history
…eme assets (#115)

Co-authored-by: Callin Mullaney <57088-callinmullaney@users.noreply.drupalcode.org>
  • Loading branch information
callinmullaney and Callin Mullaney authored Sep 16, 2024
1 parent 1431cc8 commit 41f4cc7
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions scripts/sous/theme-build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
#!/bin/sh

cd web/themes/custom/sous-project
npm ci
npm run storybook-build
# Theme directories this script needs to build.
SRC_DIR="web/themes/custom/sous-project/src"
COMPONENTS_DIR="web/themes/custom/sous-project/components"

# Check if either of the directories exists
if [ -d "$SRC_DIR" ] || [ -d "$COMPONENTS_DIR" ]; then
cd web/themes/custom/sous-project
npm ci
npm run storybook-build
else
echo "Cannot find components to compile within the sous-project theme. Skipping build step."
fi

0 comments on commit 41f4cc7

Please sign in to comment.