mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-06-04 16:54:11 -04:00
fix(frontend): move mock api files instead of removing
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
dc48d52d75
commit
1f0439b618
4 changed files with 24 additions and 8 deletions
|
@ -7,15 +7,29 @@
|
|||
|
||||
set -e
|
||||
|
||||
cleanup () {
|
||||
if [ -d ../tmp/src/pages/api ]; then
|
||||
echo "🦔 > Moving Mock API files back"
|
||||
mv ../tmp/src/pages/api src/pages
|
||||
fi
|
||||
}
|
||||
|
||||
trap cleanup EXIT
|
||||
|
||||
echo "🦔 Frontend Production Build"
|
||||
echo "🦔 > Clearing existing builds"
|
||||
rm -rf dist/
|
||||
|
||||
echo "🦔 > Preparing files"
|
||||
if [ "${1}" = "--keep-mock-api" ]; then
|
||||
echo "🦔 > Keeping Mock API"
|
||||
if [ ! -z "${NEXT_PUBLIC_USE_MOCK_API}" ]; then
|
||||
echo "🦔 > Keeping Mock API because NEXT_PUBLIC_USE_MOCK_API is set"
|
||||
if [ ! -d src/pages/api ]; then
|
||||
echo "🦔 > ⚠️ src/pages/api doesn't exist"
|
||||
fi
|
||||
else
|
||||
rm -rf src/pages/api
|
||||
echo "🦔 > Moving Mock API because NEXT_PUBLIC_USE_MOCK_API is unset"
|
||||
mkdir -p ../tmp/src/pages
|
||||
mv src/pages/api ../tmp/src/pages/api
|
||||
fi
|
||||
|
||||
echo "🦔 > Building"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue