fix: update init.sh to use correct path for accounts.env file
This commit is contained in:
17
test/init.sh
17
test/init.sh
@@ -1,15 +1,26 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
AZURITE_DIR="$HOME/.azurite"
|
||||
if [[ ! -d "$AZURITE_DIR" ]]; then
|
||||
echo "Error: Azurite data directory not found at $AZURITE_DIR" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ! -f "$AZURITE_DIR/accounts.env" ]]; then
|
||||
echo "Error: accounts.env file not found at $AZURITE_DIR/accounts.env" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ACCESS_KEY=""
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case "$1" in
|
||||
--key|-k)
|
||||
if [[ ! -f "../accounts.env" ]]; then
|
||||
echo "Error: accounts.env file not found at ../accounts.env" >&2
|
||||
if [[ ! -f "$AZURITE_DIR/accounts.env" ]]; then
|
||||
echo "Error: accounts.env file not found at $AZURITE_DIR/accounts.env" >&2
|
||||
exit 1
|
||||
fi
|
||||
# Load the accounts.env file to get the ACCESS_KEY variable.
|
||||
source "../accounts.env"
|
||||
source "$AZURITE_DIR/accounts.env"
|
||||
ACCESS_KEY=$(echo "$AZURITE_ACCOUNTS" | cut -f 1 -d ';' | cut -f 2 -d ':')
|
||||
;;
|
||||
*)
|
||||
|
||||
Reference in New Issue
Block a user