From 5bf84c0b9d7a552739291e3002c5e10a9d04279e Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Wed, 3 Jun 2015 23:46:50 +0200 Subject: [PATCH] try to automate upload of btstack-arduino-latest.zip --- platforms/arduino/Makefile | 1 + platforms/arduino/upload_latest_sftp.sh | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100755 platforms/arduino/upload_latest_sftp.sh diff --git a/platforms/arduino/Makefile b/platforms/arduino/Makefile index 31b68ceb0..b7d64a58f 100644 --- a/platforms/arduino/Makefile +++ b/platforms/arduino/Makefile @@ -42,3 +42,4 @@ release: update_version cp -r ${PATHS} ${BTSTACK_PACKAGE} rm -f ${ARCHIVE} zip -r ${ARCHIVE} btstack + cp ${ARCHIVE} btstack-arduino-latest.zip diff --git a/platforms/arduino/upload_latest_sftp.sh b/platforms/arduino/upload_latest_sftp.sh new file mode 100755 index 000000000..df3676b48 --- /dev/null +++ b/platforms/arduino/upload_latest_sftp.sh @@ -0,0 +1,19 @@ +#!/bin/bash +USAGE="Usage: upload_latest_sftp.sh host path user" + +# command line checks, bash +if [ $# -ne 3 ]; then + echo ${USAGE} + exit 0 +fi +host=$1 +path=$2 +user=$3 + +echo Uploading generated archive to ${host}/${path} with user ${user} + +# SFTP is very peculiar: recursive put only works for a single directory +sftp ${user}@${host} << EOF + put btstack-arduino-latest.zip ${path} + quit +EOF