From 2b7d5c56b25f4efad6c7c40042f884cbecb47c0b Mon Sep 17 00:00:00 2001
From: Jorge Aparicio <jorge@japaric.io>
Date: Sat, 29 Jul 2017 01:26:30 -0500
Subject: [PATCH] fix ci/install.sh

---
 ci/install.sh | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/ci/install.sh b/ci/install.sh
index 5e66588..1894bff 100644
--- a/ci/install.sh
+++ b/ci/install.sh
@@ -1,13 +1,15 @@
 set -euxo pipefail
 
 main() {
-    local vers=0.3.7
+    if [ $TARGET = thumbv7m-none-eabi ]; then
+        local vers=0.3.7
 
-    cargo install --list | grep "xargo v$vers" || \
-        cargo install xargo -f --vers $vers
+        cargo install --list | grep "xargo v$vers" || \
+            ( cd .. && cargo install xargo -f --vers $vers )
 
-    rustup component list | grep 'rust-src.*installed' || \
-        rustup component add rust-src
+        rustup component list | grep 'rust-src.*installed' || \
+            rustup component add rust-src
+    fi
 }
 
 main
-- 
GitLab