Skip to content

Commit bdc3d0c

Browse files
committed
docs: Add GitHub Pages site for install.sh
Created docs/ folder with: - CNAME: merjs.trilok.ai - install.sh: Simplified installer script - index.html: Minimal landing page To enable: 1. Repo Settings → Pages 2. Source: Deploy from branch → main → /docs 3. DNS: CNAME merjs.trilok.ai → justrach.github.io Refs #89
1 parent 9806980 commit bdc3d0c

3 files changed

Lines changed: 163 additions & 0 deletions

File tree

docs/CNAME

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
merjs.trilok.ai

docs/index.html

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title>merjs — Install</title>
6+
<meta name="viewport" content="width=device-width, initial-scale=1">
7+
<style>
8+
body {
9+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
10+
max-width: 800px;
11+
margin: 60px auto;
12+
padding: 0 20px;
13+
line-height: 1.6;
14+
color: #333;
15+
}
16+
pre {
17+
background: #f4f4f4;
18+
padding: 15px;
19+
border-radius: 5px;
20+
overflow-x: auto;
21+
}
22+
code {
23+
font-family: "SF Mono", Monaco, monospace;
24+
}
25+
a { color: #0066cc; }
26+
</style>
27+
</head>
28+
<body>
29+
<h1>🚀 merjs</h1>
30+
<p>Next.js-style web framework in Zig. Zero Node.js.</p>
31+
32+
<h2>Quick Install</h2>
33+
<pre><code>curl -fsSL https://merjs.trilok.ai/install.sh | bash</code></pre>
34+
35+
<p>Or with wget:</p>
36+
<pre><code>wget -qO- https://merjs.trilok.ai/install.sh | bash</code></pre>
37+
38+
<h2>Quick Start</h2>
39+
<pre><code>mer init myapp
40+
cd myapp
41+
mer dev</code></pre>
42+
43+
<h2>Links</h2>
44+
<ul>
45+
<li><a href="https://github.com/justrach/merjs">GitHub</a></li>
46+
<li><a href="install.sh">install.sh</a></li>
47+
</ul>
48+
49+
<p><small>v0.2.5</small></p>
50+
</body>
51+
</html>

docs/install.sh

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
#!/bin/bash
2+
# install.sh — One-liner installer for merjs
3+
# Usage: curl -fsSL https://merjs.trilok.ai/install.sh | bash
4+
5+
set -e
6+
7+
REPO="justrach/merjs"
8+
INSTALL_DIR="${INSTALL_DIR:-/usr/local/bin}"
9+
VERSION="${VERSION:-latest}"
10+
11+
detect_os() {
12+
case "$(uname -s)" in
13+
Linux*) echo "linux";;
14+
Darwin*) echo "macos";;
15+
*) echo "unknown";;
16+
esac
17+
}
18+
19+
detect_arch() {
20+
case "$(uname -m)" in
21+
x86_64|amd64) echo "x86_64";;
22+
arm64|aarch64) echo "arm64";;
23+
*) echo "unknown";;
24+
esac
25+
}
26+
27+
OS=$(detect_os)
28+
ARCH=$(detect_arch)
29+
30+
if [ "$OS" = "unknown" ] || [ "$ARCH" = "unknown" ]; then
31+
echo "Error: Unsupported platform: ${OS}/${ARCH}"
32+
exit 1
33+
fi
34+
35+
echo "🚀 merjs installer"
36+
echo " Platform: ${OS}/${ARCH}"
37+
echo " Install dir: ${INSTALL_DIR}"
38+
echo ""
39+
40+
# Get latest version
41+
if [ "$VERSION" = "latest" ]; then
42+
echo "📦 Fetching latest version..."
43+
VERSION=$(curl -s "https://api.github.com/repos/${REPO}/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
44+
if [ -z "$VERSION" ]; then
45+
VERSION="v0.2.5"
46+
fi
47+
fi
48+
49+
echo " Version: ${VERSION}"
50+
51+
# Map to release asset naming
52+
if [ "$OS" = "macos" ]; then
53+
if [ "$ARCH" = "arm64" ]; then
54+
ASSET="mer-macos-aarch64"
55+
else
56+
ASSET="mer-macos-x86_64"
57+
fi
58+
else
59+
if [ "$ARCH" = "arm64" ]; then
60+
ASSET="mer-linux-aarch64"
61+
else
62+
ASSET="mer-linux-x86_64"
63+
fi
64+
fi
65+
66+
URL="https://github.com/${REPO}/releases/download/${VERSION}/${ASSET}"
67+
68+
TMP_DIR=$(mktemp -d)
69+
trap "rm -rf $TMP_DIR" EXIT
70+
71+
echo "⬇️ Downloading ${ASSET}..."
72+
if ! curl -fsSL "$URL" -o "$TMP_DIR/mer"; then
73+
echo "Error: Failed to download ${URL}"
74+
echo "The release may not exist yet. Build from source:"
75+
echo " git clone https://github.com/${REPO}.git"
76+
echo " cd merjs && zig build cli"
77+
exit 1
78+
fi
79+
80+
echo "🔧 Installing..."
81+
82+
if [ -w "$INSTALL_DIR" ]; then
83+
SUDO=""
84+
else
85+
echo " (may prompt for sudo password)"
86+
SUDO="sudo"
87+
fi
88+
89+
$SUDO mkdir -p "$INSTALL_DIR"
90+
$SUDO cp "$TMP_DIR/mer" "${INSTALL_DIR}/mer"
91+
$SUDO chmod +x "${INSTALL_DIR}/mer"
92+
93+
if command -v mer &> /dev/null; then
94+
INSTALLED_VERSION=$(mer --version 2>/dev/null || echo "unknown")
95+
echo ""
96+
echo "✅ merjs installed successfully!"
97+
echo ""
98+
echo " Version: ${INSTALLED_VERSION}"
99+
echo " Location: $(which mer)"
100+
echo ""
101+
echo "Next steps:"
102+
echo " mer init myapp # Create a new project"
103+
echo " mer dev # Start dev server"
104+
else
105+
echo "⚠️ mer installed but not in PATH"
106+
echo " Add this to your shell profile:"
107+
echo " export PATH=\"${INSTALL_DIR}:\$PATH\""
108+
fi
109+
110+
echo ""
111+
echo "Documentation: https://github.com/justrach/merjs"

0 commit comments

Comments
 (0)