fix: deploy-edge.sh handle UTF-16 encoded token file

Windows で保存された UTF-16 ファイルの null バイト・BOM を除去して正しくトークンを読み込む

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
posimai 2026-04-04 14:25:27 +09:00
parent 9b1334747b
commit 256d8b0ea4
1 changed files with 2 additions and 1 deletions

View File

@ -23,7 +23,8 @@ if [ ! -f "$TOKEN_FILE" ]; then
exit 1 exit 1
fi fi
TOKEN=$(cat "$TOKEN_FILE" | tr -d '[:space:]') # UTF-16 (Windows メモ帳等) で保存された場合も対応: null バイト・BOM・空白を除去
TOKEN=$(tr -d '\000\r' < "$TOKEN_FILE" | tr -d '[:space:]' | sed 's/^\xef\xbb\xbf//' | grep -o 'sbp_[A-Za-z0-9]*')
if [ -z "$TOKEN" ] || [ "$TOKEN" = "YOUR_SUPABASE_ACCESS_TOKEN_HERE" ]; then if [ -z "$TOKEN" ] || [ "$TOKEN" = "YOUR_SUPABASE_ACCESS_TOKEN_HERE" ]; then
echo "[ERROR] ~/.supabase-token にトークンが設定されていません。" echo "[ERROR] ~/.supabase-token にトークンが設定されていません。"
exit 1 exit 1