debian-mirror-gitlab/scripts/frontend/start_storybook.sh
2021-11-18 22:05:49 +05:30

18 lines
577 B
Bash
Executable file
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/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 cant 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