bc66e673fa
# Conflicts: # include/builtins.h # include/data.h # include/editor_op.h # include/file_io.h # include/input.h # include/row_op.h # install.sh # main.c # meson.build # src/builtins.c # src/editor_op.c # src/file_io.c # src/init.c # src/input.c # src/output.c # src/row_op.c
45 lines
1.1 KiB
Bash
45 lines
1.1 KiB
Bash
#!/bin/bash
|
|
|
|
|
|
echo "--- Welcome to Beluga installer ---"
|
|
read -p "Do you want to start the installation ? (Y/n)" confirm && [[ $confirm == [yY] || $confirm == [yY][eE][sS] ]] || exit 1
|
|
|
|
# Check dependencies
|
|
|
|
if ! command -v "meson" &>/dev/null; then
|
|
echo "❌ Error: meson not found. Please install it first."
|
|
exit 1
|
|
fi
|
|
|
|
|
|
# Create config files
|
|
|
|
echo "Create config files ..."
|
|
mkdir -pv ~/.beluga/
|
|
mkdir -pv ~/.beluga/assets/
|
|
cp -rv ./assets/beluga.txt ~/.beluga/assets/
|
|
mkdir -pv ~/.beluga/packages/
|
|
mkdir -pv ~/.beluga/config/
|
|
|
|
read -p "Do you want to replace your config file or keep it (init.lisp.bak) / (init.lisp.new) ? (Y/n)" confirm
|
|
if [[ "$confirm" =~ ^[Yy]$ ]]; then
|
|
mv ~/.beluga/config/init.lisp ~/.beluga/config/init.lisp.bak
|
|
cp -rv ./config/init.lisp ~/.beluga/config/
|
|
else
|
|
cp -rv ./config/init.lisp ~/.beluga/config/init.lisp.new
|
|
fi
|
|
|
|
|
|
# Compile the project
|
|
|
|
echo "Start compilation ..."
|
|
meson setup build/
|
|
meson compile -C build/
|
|
|
|
# Add to path
|
|
echo "Adding beluga to the path"
|
|
sudo cp -f ./build/beluga /usr/local/bin/
|
|
|
|
echo "Installation finish"
|
|
echo "Check ~/.beluga/config/init.lisp for customization"
|