File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change 1- #! /bin/sh -e
1+ #! /usr/bin/env bash
2+
3+ set -euxo pipefail
24
35# Takes last wasp binary built by cabal and packages it together with data
46# into .tar.gz package.
911DST=$PWD /${1:- wasp.tar.gz}
1012
1113TMP_DIR=" $( mktemp -d 2> /dev/null || mktemp -d -t wasp-bin-package) "
14+ CABAL_PROJECT_ROOT_PATH=" $( cabal list-bin wasp-cli | sed s/\\ /dist-newstyle.* //) "
1215
1316WASP_BINARY_PATH=" $( cabal list-bin wasp-cli) "
1417cp " $WASP_BINARY_PATH " " $TMP_DIR /wasp-bin"
1518
16- CABAL_PROJECT_ROOT_PATH=" $( cabal list-bin wasp-cli | sed s/\\ /dist-newstyle.* //) "
17- cp -R " $CABAL_PROJECT_ROOT_PATH /data" " $TMP_DIR /data"
19+ cabal sdist --list-only \
20+ | grep " ^./data" \
21+ | while read -r data_file_path; do
22+ mkdir -p " $TMP_DIR /$( dirname " $data_file_path " ) "
23+ cp " $CABAL_PROJECT_ROOT_PATH /$data_file_path " " $TMP_DIR /$data_file_path "
24+ done
1825
19- cd " $TMP_DIR "
20- tar -czf " $DST " *
26+ tar -czf " $DST " -C " $TMP_DIR " .
2127
2228if [ -n " $TMP_DIR " ]; then rm -rf " $TMP_DIR " ; fi
2329
You can’t perform that action at this time.
0 commit comments