-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·60 lines (52 loc) · 2.87 KB
/
setup.sh
File metadata and controls
executable file
·60 lines (52 loc) · 2.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/usr/bin/env bash
# ─────────────────────────────────────────────────────────────────────
# NexWallet — One-Command Setup Script
# Usage: bash setup.sh
# ─────────────────────────────────────────────────────────────────────
set -e
CYAN='\033[0;36m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
RED='\033[0;31m'
BOLD='\033[1m'
RESET='\033[0m'
echo ""
echo -e "${CYAN}${BOLD}💎 NexWallet — Setup${RESET}"
echo -e "${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${RESET}"
echo ""
# ── Check Node.js ──────────────────────────────────────────────────
if ! command -v node &> /dev/null; then
echo -e "${RED}✗ Node.js not found.${RESET}"
echo -e " Please install Node.js v18+ from: ${YELLOW}https://nodejs.org${RESET}"
exit 1
fi
NODE_VER=$(node -v | cut -d'v' -f2 | cut -d'.' -f1)
if [ "$NODE_VER" -lt 18 ]; then
echo -e "${RED}✗ Node.js v18+ required. You have: $(node -v)${RESET}"
exit 1
fi
echo -e "${GREEN}✓ Node.js $(node -v) detected${RESET}"
# ── Check npm ──────────────────────────────────────────────────────
if ! command -v npm &> /dev/null; then
echo -e "${RED}✗ npm not found. Please reinstall Node.js.${RESET}"
exit 1
fi
echo -e "${GREEN}✓ npm $(npm -v) detected${RESET}"
# ── Install dependencies ───────────────────────────────────────────
echo ""
echo -e "${CYAN}📦 Installing dependencies...${RESET}"
npm install
# ── Success ────────────────────────────────────────────────────────
echo ""
echo -e "${GREEN}${BOLD}✅ Setup complete!${RESET}"
echo ""
echo -e "${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${RESET}"
echo -e "${BOLD}🚀 Start the app:${RESET}"
echo ""
echo -e " ${YELLOW}npm run dev${RESET} → Development server"
echo -e " ${YELLOW}npm run build${RESET} → Build for production"
echo -e " ${YELLOW}npm run deploy${RESET} → Deploy to Cloudflare Pages"
echo ""
echo -e "${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${RESET}"
echo -e " Then open: ${YELLOW}http://localhost:5173${RESET}"
echo ""