#!/bin/bash

cd "$(dirname "$0")/compiler"

CONFIG="./arduino-cli.yaml"

./arduino-cli --config-file "$CONFIG" core update-index
./arduino-cli --config-file "$CONFIG" core install Elron:MIK32_Amur

echo Install required libraries

while IFS= read -r line || [[ -n "$line" ]]; do
    if [[ -n "$line" ]]; then
        ./arduino-cli --config-file "$CONFIG" lib install "$line"
    fi
done < required_libs.txt

echo Installation done ...