fix: 优化官网内容
This commit is contained in:
33
quick-start.sh
Executable file
33
quick-start.sh
Executable file
@@ -0,0 +1,33 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
cd "$PROJECT_ROOT"
|
||||
|
||||
echo "==> Official Network quick start"
|
||||
|
||||
if ! command -v node >/dev/null 2>&1; then
|
||||
echo "Error: Node.js is not installed. Please install Node.js >= 16."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! command -v npm >/dev/null 2>&1; then
|
||||
echo "Error: npm is not installed."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
NODE_MAJOR="$(node -v | sed -E 's/^v([0-9]+).*/\1/')"
|
||||
if [[ "${NODE_MAJOR}" -lt 16 ]]; then
|
||||
echo "Warning: Detected Node.js $(node -v). Recommended: >= 16."
|
||||
fi
|
||||
|
||||
if [[ ! -d node_modules ]]; then
|
||||
echo "==> Installing dependencies..."
|
||||
npm install
|
||||
else
|
||||
echo "==> node_modules exists, skipping install."
|
||||
fi
|
||||
|
||||
echo "==> Starting development server..."
|
||||
npm run serve
|
||||
Reference in New Issue
Block a user