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
|
#!/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=""
|
ACCESS_KEY=""
|
||||||
while [[ $# -gt 0 ]]; do
|
while [[ $# -gt 0 ]]; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
--key|-k)
|
--key|-k)
|
||||||
if [[ ! -f "../accounts.env" ]]; then
|
if [[ ! -f "$AZURITE_DIR/accounts.env" ]]; then
|
||||||
echo "Error: accounts.env file not found at ../accounts.env" >&2
|
echo "Error: accounts.env file not found at $AZURITE_DIR/accounts.env" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
# Load the accounts.env file to get the ACCESS_KEY variable.
|
# 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 ':')
|
ACCESS_KEY=$(echo "$AZURITE_ACCOUNTS" | cut -f 1 -d ';' | cut -f 2 -d ':')
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
|||||||
Reference in New Issue
Block a user