#!/bin/bash

mkdir /home/meilisearch
cd /home/meilisearch
git init
git pull https://github.com/meilisearch/meilisearch

cargo build --release

mv target/release/meilisearch /usr/bin
chmod +x /usr/bin/meilisearch

rm -r /home/meilisearch

mkdir /usr/local/meilisearch

wget https://github.com/meilisearch/meilisearch/raw/refs/heads/main/config.toml -O /usr/local/meilisearch/config.toml

meilisearch --config-file-path /usr/local/meilisearch/config.toml