File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33TARGET=" "
44EXECUTOR_VERSION=" "
55EXTRA_BUNDLE=" "
6+ COMPRESSION_LEVEL=9
67
78while [[ $# -gt 0 ]]; do
89 case $1 in
@@ -32,6 +33,14 @@ while [[ $# -gt 0 ]]; do
3233 EXTRA_BUNDLE=" $( readlink -f " $EXTRA_BUNDLE " ) "
3334 shift
3435 ;;
36+ --compression-level)
37+ COMPRESSION_LEVEL=" $2 "
38+ shift 2
39+ ;;
40+ --compression-level=* )
41+ COMPRESSION_LEVEL=" ${1#* =} "
42+ shift
43+ ;;
3544 -h|--help)
3645 echo " Usage: $0 [--target TARGET] [--executor-version VERSION]"
3746 echo " --target TARGET Specify the target platform (default: universal)"
@@ -56,6 +65,13 @@ if [[ -n "$EXECUTOR_VERSION" && -z "$EXECUTOR_VERSION" ]]; then
5665 exit 1
5766fi
5867
68+ if [[ " $COMPRESSION_LEVEL " == [0-9] ]]; then
69+ true
70+ else
71+ echo " Error: --compression-level must be an integer between 0 and 9" >&2
72+ exit 1
73+ fi
74+
5975HEAD_REVISION=$( git rev-parse HEAD)
6076
6177echo " \$ TARGET = $TARGET "
87103 tar -A -f " $PREV /build/genvm-$TARGET .tar" " $EXTRA_BUNDLE "
88104fi
89105
90- xz -z -9 --force " $PREV /build/genvm-$TARGET .tar"
106+ xz -z " - $COMPRESSION_LEVEL " --force " $PREV /build/genvm-$TARGET .tar"
91107
92108popd
You can’t perform that action at this time.
0 commit comments