summaryrefslogtreecommitdiff
path: root/scripts/frontend/start_storybook.sh
blob: 7ae0a21b15b4b587a437ff228e171af479f7fc66 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash

bold=$(tput bold)
normal=$(tput sgr0)

echo -e "Storybook provides a mock server that allows creating stories for components that make HTTP requests."
echo -e "${bold}Storybook will fail to start if it can’t find the fixtures used by the mock server.${normal}\n"
read -rp "Would you like to generate/update the frontend fixtures used by the mock server (y/N)? " answer

if [[ "$answer" =~ ^(Y|y)$ ]] ; then
  bundle exec rake frontend:mock_server_fixtures
fi

if ! [[ -d storybook/node_modules ]] ; then
  yarn storybook:install
fi

yarn --cwd ./storybook start