From d8f8de953044328932836a450cbb4157736ba2d2 Mon Sep 17 00:00:00 2001 From: xengineering Date: Fri, 7 Jun 2024 17:40:14 +0200 Subject: tools: Add download.sh to get external doc files It is unknown if it would be legal to include those external documents like datasheets inside this Git repository. Thus the added script provides the ability to get them directly from the vendor. --- tools/download.sh | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 tools/download.sh diff --git a/tools/download.sh b/tools/download.sh new file mode 100755 index 0000000..901fd3f --- /dev/null +++ b/tools/download.sh @@ -0,0 +1,35 @@ +#!/bin/sh + + +set -euf + + +# absolute paths +script="$(realpath $0)" +tools="$(dirname "${script}")" +src="$(dirname "${tools}")" +doc="${src}/doc" + +documents=' +ft232r.pdf https://www.ftdichip.com/old2020/Support/Documents/DataSheets/ICs/DS_FT232R.pdf +' + + +mkdir -pv "$doc" + +echo "$documents" | while read line +do + if [ "$line" == '' ] + then + continue + fi + + name="$(echo "$line" | cut -d$'\t' -f1)" + url="$(echo "$line" | cut -d$'\t' -f2)" + path="${doc}/${name}" + + if [ ! -f "$path" ] + then + curl "$url" > "$path" + fi +done -- cgit v1.2.3-70-g09d2