71 lines
1.3 KiB
Text
71 lines
1.3 KiB
Text
|
#!/bin/sh -e
|
||
|
|
||
|
ROOT=`dirname $0`
|
||
|
VERSION=""
|
||
|
RELEASE=""
|
||
|
|
||
|
cd "$ROOT/.."
|
||
|
|
||
|
POSITIONAL=()
|
||
|
while [[ $# -gt 0 ]]; do
|
||
|
key="$1"
|
||
|
|
||
|
case $key in
|
||
|
--version)
|
||
|
VERSION="$2"
|
||
|
shift
|
||
|
shift
|
||
|
;;
|
||
|
--beta)
|
||
|
RELEASE="beta"
|
||
|
shift
|
||
|
;;
|
||
|
--release)
|
||
|
RELEASE="production"
|
||
|
shift
|
||
|
;;
|
||
|
*)
|
||
|
POSITIONAL+=("$1")
|
||
|
shift
|
||
|
;;
|
||
|
esac
|
||
|
done
|
||
|
set -- "${POSITIONAL[@]}"
|
||
|
|
||
|
if [ -z "$VERSION" ] && [ -n "$RELEASE" ]; then
|
||
|
echo "Version is required if making a release"
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
if [ -n "$RELEASE" ]; then
|
||
|
read -p "Deploy release for browser: $RELEASE v$VERSION? [y/N] " -r
|
||
|
if [ -z "$REPLY" ] || [ "$REPLY" != "y" ]; then
|
||
|
exit 2
|
||
|
fi
|
||
|
|
||
|
PACKAGE_VERSION=`node -p -e "require('./packages/desktop-electron/package.json').version"`
|
||
|
if [ "$VERSION" != "$PACKAGE_VERSION" ] && [ "$VERSION-next" != "$PACKAGE_VERSION" ]; then
|
||
|
echo "Version in desktop-electron/package.json does not match given version! ($PACKAGE_VERSION)"
|
||
|
exit 4
|
||
|
fi
|
||
|
fi
|
||
|
|
||
|
yarn lint
|
||
|
|
||
|
(
|
||
|
cd packages/loot-design;
|
||
|
../../node_modules/.bin/patch-package
|
||
|
)
|
||
|
|
||
|
(
|
||
|
cd packages/loot-core;
|
||
|
ACTUAL_RELEASE_TYPE=$RELEASE yarn build:browser
|
||
|
)
|
||
|
|
||
|
(
|
||
|
cd packages/desktop-client;
|
||
|
REACT_APP_RELEASE_TYPE=$RELEASE yarn build:browser
|
||
|
)
|
||
|
|
||
|
echo "packages/desktop-client/build"
|