fix: update run.sh to use current directory for AZURITE_DIR and correct env-file paths
This commit is contained in:
15
run.sh
15
run.sh
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
AZURITE_DIR="${AZURITE_DIR:-./storage}"
|
||||
AZURITE_DIR="${AZURITE_DIR:-$(pwd)}"
|
||||
CONTAINER_ARGS=()
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
@@ -10,6 +10,15 @@ while [[ $# -gt 0 ]]; do
|
||||
CONTAINER_ARGS+=("--oauth")
|
||||
shift
|
||||
;;
|
||||
-d|--azurite-dir)
|
||||
if [[ -n "$2" && -d "$2" ]]; then
|
||||
AZURITE_DIR="$2"
|
||||
shift 2
|
||||
else
|
||||
echo "Error: Selected directory does not exist." >&2
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo "Unknown argument: $1" >&2
|
||||
exit 1
|
||||
@@ -18,9 +27,9 @@ while [[ $# -gt 0 ]]; do
|
||||
done
|
||||
|
||||
if command -v dockerd &> /dev/null; then
|
||||
docker run --rm -d --name azurite --env-file accounts.env -p 443:443 -v "$AZURITE_DIR":/storage azurite:latest "${CONTAINER_ARGS[@]}"
|
||||
docker run --rm -d --name azurite --env-file "$AZURITE_DIR/accounts.env" -p 443:443 -v "$AZURITE_DIR/storage":/storage azurite:latest "${CONTAINER_ARGS[@]}"
|
||||
elif command -v container &> /dev/null; then
|
||||
container run --rm -d --name azurite --env-file accounts.env -p 443:443 --mount type=bind,source="$AZURITE_DIR",target=/storage azurite:latest "${CONTAINER_ARGS[@]}"
|
||||
container run --rm -d --name azurite --env-file "$AZURITE_DIR/accounts.env" -p 443:443 --mount type=bind,source="$AZURITE_DIR/storage",target=/storage azurite:latest "${CONTAINER_ARGS[@]}"
|
||||
else
|
||||
echo "Neither supported container runtime found." >&2
|
||||
exit 1
|
||||
|
||||
Reference in New Issue
Block a user