2020-09-19 17:56:28 +03:00
|
|
|
#!/bin/sh -e
|
|
|
|
|
2022-03-16 18:00:18 +03:00
|
|
|
# Takes last wasp binary built by cabal and packages it together with data
|
2021-04-24 11:36:13 +03:00
|
|
|
# into .tar.gz package.
|
2020-09-19 17:56:28 +03:00
|
|
|
|
2021-04-24 11:36:13 +03:00
|
|
|
# First and only argument is the filename of the package to be generated.
|
|
|
|
# It is optional.
|
|
|
|
|
|
|
|
DST=$PWD/${1:-wasp.tar.gz}
|
2020-09-19 17:56:28 +03:00
|
|
|
|
|
|
|
TMP_DIR="$(mktemp -d 2>/dev/null || mktemp -d -t wasp-bin-package)"
|
|
|
|
|
2022-03-16 18:00:18 +03:00
|
|
|
WASP_BINARY_PATH="$(cabal list-bin wasp-cli)"
|
|
|
|
cp "$WASP_BINARY_PATH" "$TMP_DIR/wasp-bin"
|
|
|
|
|
|
|
|
CABAL_PROJECT_ROOT_PATH="$(cabal list-bin wasp-cli | sed s/\\/dist-newstyle.*//)"
|
|
|
|
cp -R "$CABAL_PROJECT_ROOT_PATH/data" "$TMP_DIR/data"
|
2020-09-19 17:56:28 +03:00
|
|
|
|
|
|
|
cd "$TMP_DIR"
|
|
|
|
tar -czf "$DST" *
|
|
|
|
|
|
|
|
if [ -n "$TMP_DIR" ]; then rm -rf "$TMP_DIR"; fi
|
|
|
|
|
|
|
|
echo "Generated binary package: $DST."
|