#!/bin/sh cd ${0%/*} # go to project root if [ $# -eq 0 ]; then echo "Please provide the path" exit 1 fi URL="https://ftp.batnako.net/tilesets" FILES=$1 mkdir -p "$FILES/tilesets" function download { path="$FILES/tilesets/$name" rm -rf "$path" mkdir "$path" for ((i=0; i<${#tiles[@]}; i++)); do image="${tiles[$i]}.ppm" wget -O "$path/$image" "$URL/$name/$image" done wget -O "$path/tileset.h" "$URL/$name/tileset.h" } name="black-white" tiles=("corner" "cross" "empty" "line" "t") download name="knots" tiles=("corner" "cross" "empty" "line" "t") download name="circuit" tiles=("bridge" "component" "connection" "corner" "dskew" "skew" "substrate" "t" "track" "transition" "turn" "viad" "vias" "wire") download