1#!/bin/bash
2
3bold=$(tput bold)
4normal=$(tput sgr0)
5
6echo -e "Storybook provides a mock server that allows creating stories for components that make HTTP requests."
7echo -e "${bold}Storybook will fail to start if it can’t find the fixtures used by the mock server.${normal}\n"
8read -rp "Would you like to generate/update the frontend fixtures used by the mock server (y/N)? " answer
9
10if [[ "$answer" =~ ^(Y|y)$ ]] ; then
11  bundle exec rake frontend:mock_server_fixtures
12fi
13
14if ! [[ -d storybook/node_modules ]] ; then
15  yarn storybook:install
16fi
17
18yarn --cwd ./storybook start
19