Files
threshold/scripts/uigen.sh
T
Susmitha Girumala 7f1a12ecaa Update ui build to use 'admin' folder instead of 'core' (#792)
* Update ui build to use 'admin' folder instead of 'core'

Post release of v0.1.2, ui/core folder has been renamed to ui/admin.
Update ui build scripts to be aware of the path change.

* Update packagespec to reflect "admin" ui folder change
2020-11-18 16:29:48 -05:00

27 lines
550 B
Bash
Executable File

#!/bin/sh
set -e
if [ -z "$UI_CLONE_DIR" ]; then
echo "Must set UI_CLONE_DIR"; exit 1
fi
if [ -z "$UI_ASSETS_FILE" ]; then
echo "Must set UI_ASSETS_FILE"; exit 1
fi
(
cd "$UI_CLONE_DIR"
if ! docker-compose -f docker-compose-embedding.yml run build; then
yarn install && yarn build
fi
)
uidir="${UI_CLONE_DIR}/ui/admin/dist"
go-bindata -fs -o "$UI_ASSETS_FILE.tmp" -pkg ui -prefix "${uidir}" "${uidir}" "${uidir}/assets"
printf "// +build ui\n" > "$UI_ASSETS_FILE"
cat "$UI_ASSETS_FILE.tmp" >> "$UI_ASSETS_FILE"
rm "$UI_ASSETS_FILE.tmp"