game-and-watch-backup/config.sh

19 lines
435 B
Bash
Raw Normal View History

2020-12-02 04:14:00 +00:00
#!/bin/bash
OPENOCD=${OPENOCD:-$(which openocd)}
if [[ -z ${OPENOCD} ]]; then
echo "Cannot find 'openocd' in the PATH. You can set the environment variable 'OPENOCD' to manually specify the location"
exit 2
fi
2020-12-12 17:48:34 +00:00
OPENOCD_VERSION=$(${OPENOCD} -v 2> >(cut -f 4 -d" " ) |head -1)
ADAPTER=$1
2020-12-02 04:14:00 +00:00
mkdir -p logs backups
if [[ $# -ne 1 ]] && [[ ! "$0" =~ .*"config.sh" ]]; then
echo "Usage: $0 <Adapter: jlink or stlink>"
exit 1
fi