From 2d82317004c49e54d4d2fb7afdeaf6f1c4dba5f5 Mon Sep 17 00:00:00 2001 From: Julia Date: Fri, 10 Jan 2025 13:29:02 +0300 Subject: [PATCH] Keep multiple versions of nats-server --- scripts/nats-server | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/nats-server b/scripts/nats-server index 5829bb5..db92bea 100755 --- a/scripts/nats-server +++ b/scripts/nats-server @@ -6,12 +6,13 @@ export DEFAULT_NATS_SERVER_VERSION=latest export NATS_SERVER_VERSION="${NATS_SERVER_VERSION:=$DEFAULT_NATS_SERVER_VERSION}" platform=$(uname -s) +server_path=tmp/nats-server/nats-server-$platform-$NATS_SERVER_VERSION -if [ ! -f ./tmp/nats-server/nats-server-$platform ]; then +if [ ! -f ./$server_path ]; then echo "NATS server is not installed, downloading..." mkdir -p tmp/nats-server curl -sf https://binaries.nats.dev/nats-io/nats-server/v2@$NATS_SERVER_VERSION | PREFIX=$(pwd)/tmp/nats-server/ sh - mv tmp/nats-server/nats-server tmp/nats-server/nats-server-$platform + mv tmp/nats-server/nats-server $server_path fi -./tmp/nats-server/nats-server-$platform $@ +./$server_path $@