From 796261d538cb3b9561a70e5385ec157e15ff3e10 Mon Sep 17 00:00:00 2001 From: Julien Cretin Date: Sun, 9 Feb 2020 14:29:53 +0100 Subject: [PATCH 1/2] Check that rustup and pip3 are installed Fixes #25 --- docs/install.md | 2 +- setup.sh | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/docs/install.md b/docs/install.md index a060347..ca93d83 100644 --- a/docs/install.md +++ b/docs/install.md @@ -43,7 +43,7 @@ This guide **does not** cover how to setup the JTAG probe on your system. In order to compile and flash a working OpenSK firmware, you will need the following: -* a working [Rust](https://rustup.rs/) toolchain installed on your system +* rustup (can be installed with https://rustup.rs/) * python3 and pip * the OpenSSL command line tool diff --git a/setup.sh b/setup.sh index ccaf518..091fc33 100755 --- a/setup.sh +++ b/setup.sh @@ -13,6 +13,19 @@ # See the License for the specific language governing permissions and # limitations under the License. +set -e + +# Check that rustup and pip3 are installed +check_command () { + if ! which "$1" >/dev/null + then + echo "Missing $1 command.$2" + exit 1 + fi +} +check_command rustup " Follow the steps under https://rustup.rs/ to install it." +check_command pip3 + # Ensure the submodules are pulled and up-to-date git submodule update --init From 53b46ce6d5596d3565815bd4381c9f18acd6d72c Mon Sep 17 00:00:00 2001 From: Julien Cretin Date: Mon, 10 Feb 2020 10:39:28 +0100 Subject: [PATCH 2/2] Add instructions to re-run setup.sh --- setup.sh | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/setup.sh b/setup.sh index 091fc33..ae0fd0c 100755 --- a/setup.sh +++ b/setup.sh @@ -31,13 +31,31 @@ git submodule update --init done_text="$(tput bold)DONE.$(tput sgr0)" +patch_conflict_detected () { + cat <