diff --git a/README.md b/README.md index ff01845..5107470 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,19 @@ It aims to be complete general purpose IDE.
(It is still very much a work in progress so a lot of things may seem incomplete)
For now it is just a single file editor. I plan to add a multi-file support with file pickers and tabs soon.
+## 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.
+It also requires `libmagic` to be installed (most systems have it preinstalled).
+Currently only for Linux.
+*Tested with arch linux and ubuntu*
+ ## Building ### Get started diff --git a/TODO.md b/TODO.md index 17b8d2e..721286f 100644 --- a/TODO.md +++ b/TODO.md @@ -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. diff --git a/installer.sh b/installer.sh index 0109bd1..b8b586a 100644 --- a/installer.sh +++ b/installer.sh @@ -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/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