21 lines
1014 B
Bash
21 lines
1014 B
Bash
#!/bin/bash
|
||
set -u
|
||
cd /var/www/onebot
|
||
DIR=public/dist/handsontable
|
||
mkdir -p "$DIR"
|
||
|
||
BASE="https://cdn.jsdelivr.net/npm/handsontable@14.6.2/dist"
|
||
echo "=== 下载 Handsontable 14.6.2 ==="
|
||
curl -s -m 60 -o "$DIR/handsontable.full.min.js" "$BASE/handsontable.full.min.js" && echo "js ok $(wc -c < "$DIR/handsontable.full.min.js") bytes"
|
||
curl -s -m 60 -o "$DIR/handsontable.full.min.css" "$BASE/handsontable.full.min.css" && echo "css ok $(wc -c < "$DIR/handsontable.full.min.css") bytes"
|
||
|
||
echo ""
|
||
echo "=== 校验(js 应有 Handsontable 关键字,css 应有 .handsontable) ==="
|
||
head -c 60 "$DIR/handsontable.full.min.js"; echo ""
|
||
grep -c "handsontable" "$DIR/handsontable.full.min.css" 2>/dev/null || echo "css 校验失败"
|
||
|
||
echo ""
|
||
echo "=== 通过 web 验证可访问 ==="
|
||
curl -s -o /dev/null -w "js HTTP=%{http_code}\n" "http://127.0.0.1:8081/dist/handsontable/handsontable.full.min.js"
|
||
curl -s -o /dev/null -w "css HTTP=%{http_code}\n" "http://127.0.0.1:8081/dist/handsontable/handsontable.full.min.css"
|