-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·61 lines (52 loc) · 1.78 KB
/
install.sh
File metadata and controls
executable file
·61 lines (52 loc) · 1.78 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
61
#!/bin/bash
# Typst REPL Installer
set -e
INSTALL_DIR="${INSTALL_DIR:-$HOME/bin}"
CONFIG_DIR="${CONFIG_DIR:-$HOME/.config/typrepl}"
echo "Typst REPL Installer"
echo "===================="
echo ""
echo "Install directory: $INSTALL_DIR"
echo "Config directory: $CONFIG_DIR"
echo ""
# Check typst
if ! command -v typst &>/dev/null; then
echo "Warning: typst not found. Install with: pacman -S typst"
fi
# Create directories
mkdir -p "$INSTALL_DIR"
mkdir -p "$CONFIG_DIR"/{plugins,themes,snippets,sessions,history,projects}
# Copy binaries
echo "Installing binaries..."
cp bin/typrepl "$INSTALL_DIR/"
cp bin/typst-tui "$INSTALL_DIR/"
cp bin/typst-new "$INSTALL_DIR/"
cp bin/typst-compile "$INSTALL_DIR/"
cp bin/typst-convert "$INSTALL_DIR/"
chmod +x "$INSTALL_DIR"/typrepl "$INSTALL_DIR"/typst-*
# Copy shared files
echo "Installing shared files..."
cp -r share/plugins/* "$CONFIG_DIR/plugins/" 2>/dev/null || true
cp -r share/themes/* "$CONFIG_DIR/themes/" 2>/dev/null || true
cp -r share/snippets/* "$CONFIG_DIR/snippets/" 2>/dev/null || true
cp share/completion.bash "$CONFIG_DIR/" 2>/dev/null || true
# Add completion to bashrc
if ! grep -q "typrepl/completion.bash" "$HOME/.bashrc" 2>/dev/null; then
echo "" >> "$HOME/.bashrc"
echo "# Typst REPL completion" >> "$HOME/.bashrc"
echo '[ -f ~/.config/typrepl/completion.bash ] && source ~/.config/typrepl/completion.bash' >> "$HOME/.bashrc"
echo "Added bash completion"
fi
echo ""
echo "✓ Installation complete!"
echo ""
echo "Commands:"
echo " typrepl - Start REPL"
echo " typst-new - Create project"
echo " typst-tui - Terminal UI"
echo " typst-compile - Compile documents"
echo " typst-convert - Convert formats"
echo ""
echo "Quick start:"
echo " typrepl new mypaper paper"
echo " typrepl open mypaper"