1#!/usr/bin/env bash
2# SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
3# SPDX-License-Identifier: Apache-2.0
4
5set -eo pipefail
6
7install_imgtool() {
8    pip install imgtool
9}
10
11install_idf() {
12    pushd $HOME
13    git clone --depth=1 https://github.com/espressif/esp-idf.git --branch release/v5.1
14    [[ $? -ne 0 ]] && exit 1
15
16    $HOME/esp-idf/install.sh
17    [[ $? -ne 0 ]] && exit 1
18
19    popd
20}
21
22install_imgtool
23install_idf
24