Skip to content

Commit 83b1150

Browse files
committed
remove date
1 parent 37751ca commit 83b1150

1 file changed

Lines changed: 2 additions & 18 deletions

File tree

  • src/artifacts-helper/scripts

src/artifacts-helper/scripts/az.sh

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -78,26 +78,10 @@ if [[ "$1" == "account" && "$2" == "get-access-token" ]]; then
7878
exit_code=$?
7979

8080
if [[ $exit_code -eq 0 && -n "$token" ]]; then
81-
# Calculate expiry timestamps (conservative 1 hour estimate)
82-
# expires_on = POSIX timestamp, expiresOn = local datetime
83-
if date --version >/dev/null 2>&1; then
84-
# GNU date (Linux)
85-
expires_on=$(date -d "+1 hour" "+%s")
86-
expires_on_datetime=$(date -d "+1 hour" "+%Y-%m-%d %H:%M:%S.000000")
87-
else
88-
# BSD date (macOS)
89-
expires_on=$(date -v+1H "+%s")
90-
expires_on_datetime=$(date -v+1H "+%Y-%m-%d %H:%M:%S.000000")
91-
fi
92-
93-
# Return in az CLI JSON format (matching real az CLI output)
81+
# Return in az CLI JSON format
9482
cat <<EOF
9583
{
9684
"accessToken": "${token}",
97-
"expiresOn": "${expires_on_datetime}",
98-
"expires_on": ${expires_on},
99-
"subscription": "",
100-
"tenant": "",
10185
"tokenType": "Bearer"
10286
}
10387
EOF
@@ -114,4 +98,4 @@ if [[ -n "$AZ_EXE" ]]; then
11498
else
11599
echo "Error: Azure CLI not found in PATH" >&2
116100
exit 1
117-
fi
101+
fi

0 commit comments

Comments
 (0)