Fix installation stuff

This commit is contained in:
2026-01-28 23:16:59 +00:00
parent cef357ffdc
commit 9757a8db31
3 changed files with 67 additions and 46 deletions

View File

@@ -12,6 +12,19 @@ It aims to be complete general purpose IDE.<br>
(It is still very much a work in progress so a lot of things may seem incomplete)<br>
For now it is just a single file editor. I plan to add a multi-file support with file pickers and tabs soon.<br>
## Installation
Binary can be installed with the following command:
```bash
curl https://syedm.dev/crib | sh
```
It requires `libruby-3.2.so` or `libruby.so.3.4` to be installed in the system.<br>
It also requires `libmagic` to be installed (most systems have it preinstalled).<br>
Currently only for Linux.<br>
*Tested with arch linux and ubuntu*<br>
## Building
### Get started

View File

@@ -9,6 +9,7 @@ Copyright 2025 Syed Daanish
* [ ] **Critical Crash:** Fix bug where closing immediately while LSP is still loading hangs and then segfaults (especially on slow ones like fish-lsp where quick edits and exit can hang).
* [ ] **Line move:** fix the move line functions to work without the calculations from folds as folds are removed.
* [ ] **Editor Indentation Fix:** - Main : merger indentation with the parser for more accurate results.
* [ ] Fix bug where enter at start of line with ending type crashes
* [ ] Keep cache of language maps in engine to reduce lookup time.
* [ ] In indents add function to support tab which indents if before any content and inserts a pure \t otherwise.
* [ ] And backspace which undents if before any content.

View File

@@ -1,10 +1,14 @@
#!/usr/bin/env bash
set -e
#!/usr/bin/env sh
BINARY_NAME="crib"
VERSION="v0.0.1-alpha"
set -eu
install() {
BINARY_NAME="crib"
VERSION="v0.0.1-alpha"
RUBY_VERSION="3.4"
HAVE_34=0
HAVE_32=0
if [ -z "$RUBY_VERSION" ]; then
if ldconfig -p | grep -q libruby.so.3.4; then
HAVE_34=1
fi
@@ -17,7 +21,7 @@ if [ -z "$RUBY_VERSION" ]; then
echo "Select Ruby ABI:"
echo " 1) Ruby 3.4"
echo " 2) Ruby 3.2"
read -r choice
read -r choice </dev/tty
case "$choice" in
1) RUBY_VERSION="3.4" ;;
2) RUBY_VERSION="3.2" ;;
@@ -34,51 +38,54 @@ if [ -z "$RUBY_VERSION" ]; then
echo "No compatible Ruby library found need Ruby 3.2 or 3.4."
exit 1
fi
fi
GITHUB_URL="https://github.com/SyedM-dev/crib/releases/download/$VERSION/crib-linux-x86_64-ruby$RUBY_VERSION"
GITHUB_URL="https://github.com/SyedM-dev/crib/releases/download/$VERSION/crib-linux-x86_64-ruby$RUBY_VERSION"
missing=()
command -v ruby >/dev/null 2>&1 || missing+=("ruby")
ldconfig -p | grep libmagic >/dev/null 2>&1 || missing+=("libmagic")
missing_ruby=""
missing_magic=""
command -v ruby >/dev/null 2>&1 || missing_ruby="ruby"
ldconfig -p | grep libmagic >/dev/null 2>&1 || missing_magic="libmagic"
if [ ${#missing[@]} -ne 0 ]; then
echo "Missing dependencies: ${missing[*]}"
echo "Install them using your package manager:"
echo "Ubuntu/Debian: sudo apt install ruby libmagic1"
echo "Arch: sudo pacman -S ruby file"
echo "Void: sudo xbps-install -Sy ruby file"
exit 1
fi
if [ -n "$missing_ruby" ] || [ -n "$missing_magic" ]; then
echo "Missing dependencies: ${missing_ruby} ${missing_magic}"
echo "Install them using your package manager:"
echo "Ubuntu/Debian: sudo apt install ruby libmagic1"
echo "Arch: sudo pacman -S ruby file"
echo "Void: sudo xbps-install -Sy ruby file"
exit 1
fi
echo "Installing Crib (Ruby $RUBY_VERSION)"
echo "Installing Crib (Ruby $RUBY_VERSION)"
echo "Install locally ~/.local/bin or globally /usr/bin? [l/g]"
read -r choice
case "$choice" in
l | L)
INSTALL_DIR="$HOME/.local/bin"
SUDO=""
;;
g | G)
INSTALL_DIR="/usr/bin"
SUDO="sudo"
;;
*)
echo "Invalid choice"
exit 1
;;
esac
echo "Install locally (~/.local/bin) or globally (/usr/bin)? [l/g]"
read -r choice </dev/tty
case "$choice" in
l | L)
INSTALL_DIR="$HOME/.local/bin"
SUDO=""
;;
g | G)
INSTALL_DIR="/usr/bin"
SUDO="sudo"
;;
*)
echo "Invalid choice"
exit 1
;;
esac
$SUDO mkdir -p "$INSTALL_DIR"
$SUDO mkdir -p "$INSTALL_DIR"
echo "Downloading binary..."
curl -L "$GITHUB_URL" -o /tmp/"$BINARY_NAME"
$SUDO install -m 755 /tmp/"$BINARY_NAME" "$INSTALL_DIR/$BINARY_NAME"
rm -f /tmp/"$BINARY_NAME"
echo "Downloading binary..."
curl -L "$GITHUB_URL" -o /tmp/"$BINARY_NAME"
$SUDO install -m 755 /tmp/"$BINARY_NAME" "$INSTALL_DIR/$BINARY_NAME"
rm -f /tmp/"$BINARY_NAME"
echo
echo "✔ Crib installed to $INSTALL_DIR"
echo "Run with: $BINARY_NAME"
echo "Ruby ABI: $RUBY_VERSION"
echo "Add $INSTALL_DIR to PATH if needed."
echo
echo "✔ Crib installed to $INSTALL_DIR"
echo "Run with: $BINARY_NAME"
echo "Ruby ABI: $RUBY_VERSION"
echo "Add $INSTALL_DIR to PATH if needed."
}
install "$@"