Skip to content

Commit 0705d2d

Browse files
committed
Improved build script to accept tag, py version as argument for local build
Also added a regex to get only the version, thus allowing us to add test or dev as suffix
1 parent 7a1e954 commit 0705d2d

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

build/build.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ function get_deps() {
8989
# Generate AP manifest into the destination directory.
9090
##
9191
function generate_ap_manifest() {
92-
local destdir="$1" world_version="$2"
92+
local destdir="$1" world_version="$(echo $2 | grep -Po '(?<=v)\d+.\d+.\d+')"
9393
echo "=> Generating Archipelago Manifest"
9494

9595
cat <<-EOF > "$destdir/archipelago.json"
@@ -188,8 +188,6 @@ function main() {
188188
local tag="${TAG:-$(date '+%Y-%m-%d_%H%M')}"
189189
local py_version="${PY_VERSION}"
190190
local project="$(realpath ${CWD}/..)"
191-
local bundle="${bundle_base}-${tag}-${py_version}"
192-
local destdir="${target_path}/${bundle}"
193191
local local_install=false
194192

195193
# Loop through all the arguments
@@ -198,8 +196,17 @@ function main() {
198196
local_install=true
199197
break
200198
fi
199+
if [[ $arg == --tag=* ]]; then
200+
tag=${arg#*=}
201+
fi
202+
if [[ $arg == --py_version=* ]]; then
203+
py_version=${arg#*=}
204+
fi
201205
done
202206

207+
local bundle="${bundle_base}-${tag}-${py_version}"
208+
local destdir="${target_path}/${bundle}"
209+
203210
if [ "$local_install" == true ]; then
204211
# Copy project/lib to destdir
205212
mkdir -p "${destdir}"

0 commit comments

Comments
 (0)