Fix installation stuff
This commit is contained in:
13
README.md
13
README.md
@@ -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>
|
(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>
|
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
|
## Building
|
||||||
|
|
||||||
### Get started
|
### Get started
|
||||||
|
|||||||
1
TODO.md
1
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).
|
* [ ] **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.
|
* [ ] **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.
|
* [ ] **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.
|
* [ ] 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.
|
* [ ] 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.
|
* [ ] And backspace which undents if before any content.
|
||||||
|
|||||||
99
installer.sh
99
installer.sh
@@ -1,10 +1,14 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env sh
|
||||||
set -e
|
|
||||||
|
|
||||||
BINARY_NAME="crib"
|
set -eu
|
||||||
VERSION="v0.0.1-alpha"
|
|
||||||
|
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
|
if ldconfig -p | grep -q libruby.so.3.4; then
|
||||||
HAVE_34=1
|
HAVE_34=1
|
||||||
fi
|
fi
|
||||||
@@ -17,7 +21,7 @@ if [ -z "$RUBY_VERSION" ]; then
|
|||||||
echo "Select Ruby ABI:"
|
echo "Select Ruby ABI:"
|
||||||
echo " 1) Ruby 3.4"
|
echo " 1) Ruby 3.4"
|
||||||
echo " 2) Ruby 3.2"
|
echo " 2) Ruby 3.2"
|
||||||
read -r choice
|
read -r choice </dev/tty
|
||||||
case "$choice" in
|
case "$choice" in
|
||||||
1) RUBY_VERSION="3.4" ;;
|
1) RUBY_VERSION="3.4" ;;
|
||||||
2) RUBY_VERSION="3.2" ;;
|
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."
|
echo "No compatible Ruby library found need Ruby 3.2 or 3.4."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
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=()
|
missing_ruby=""
|
||||||
command -v ruby >/dev/null 2>&1 || missing+=("ruby")
|
missing_magic=""
|
||||||
ldconfig -p | grep libmagic >/dev/null 2>&1 || missing+=("libmagic")
|
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
|
if [ -n "$missing_ruby" ] || [ -n "$missing_magic" ]; then
|
||||||
echo "Missing dependencies: ${missing[*]}"
|
echo "Missing dependencies: ${missing_ruby} ${missing_magic}"
|
||||||
echo "Install them using your package manager:"
|
echo "Install them using your package manager:"
|
||||||
echo "Ubuntu/Debian: sudo apt install ruby libmagic1"
|
echo "Ubuntu/Debian: sudo apt install ruby libmagic1"
|
||||||
echo "Arch: sudo pacman -S ruby file"
|
echo "Arch: sudo pacman -S ruby file"
|
||||||
echo "Void: sudo xbps-install -Sy ruby file"
|
echo "Void: sudo xbps-install -Sy ruby file"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Installing Crib (Ruby $RUBY_VERSION)"
|
echo "Installing Crib (Ruby $RUBY_VERSION)"
|
||||||
|
|
||||||
echo "Install locally ~/.local/bin or globally /usr/bin? [l/g]"
|
echo "Install locally (~/.local/bin) or globally (/usr/bin)? [l/g]"
|
||||||
read -r choice
|
read -r choice </dev/tty
|
||||||
case "$choice" in
|
case "$choice" in
|
||||||
l | L)
|
l | L)
|
||||||
INSTALL_DIR="$HOME/.local/bin"
|
INSTALL_DIR="$HOME/.local/bin"
|
||||||
SUDO=""
|
SUDO=""
|
||||||
;;
|
;;
|
||||||
g | G)
|
g | G)
|
||||||
INSTALL_DIR="/usr/bin"
|
INSTALL_DIR="/usr/bin"
|
||||||
SUDO="sudo"
|
SUDO="sudo"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Invalid choice"
|
echo "Invalid choice"
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
$SUDO mkdir -p "$INSTALL_DIR"
|
$SUDO mkdir -p "$INSTALL_DIR"
|
||||||
|
|
||||||
echo "Downloading binary..."
|
echo "Downloading binary..."
|
||||||
curl -L "$GITHUB_URL" -o /tmp/"$BINARY_NAME"
|
curl -L "$GITHUB_URL" -o /tmp/"$BINARY_NAME"
|
||||||
$SUDO install -m 755 /tmp/"$BINARY_NAME" "$INSTALL_DIR/$BINARY_NAME"
|
$SUDO install -m 755 /tmp/"$BINARY_NAME" "$INSTALL_DIR/$BINARY_NAME"
|
||||||
rm -f /tmp/"$BINARY_NAME"
|
rm -f /tmp/"$BINARY_NAME"
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "✔ Crib installed to $INSTALL_DIR"
|
echo "✔ Crib installed to $INSTALL_DIR"
|
||||||
echo "Run with: $BINARY_NAME"
|
echo "Run with: $BINARY_NAME"
|
||||||
echo "Ruby ABI: $RUBY_VERSION"
|
echo "Ruby ABI: $RUBY_VERSION"
|
||||||
echo "Add $INSTALL_DIR to PATH if needed."
|
echo "Add $INSTALL_DIR to PATH if needed."
|
||||||
|
}
|
||||||
|
|
||||||
|
install "$@"
|
||||||
|
|||||||
Reference in New Issue
Block a user