File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed
Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/sh -
2+ #
3+ # Use the correct hid-flash program based on the host
4+ #
5+
6+ # Get the directory where the script is running.
7+ DIR=$( cd " $( dirname " $0 " ) " && pwd)
8+ UNAME_OS=" $( uname -s) "
9+ case " ${UNAME_OS} " in
10+ Linux* )
11+ # Choose program by arch
12+ UNAME_ARCH=" $( uname -m) "
13+ case " ${UNAME_ARCH} " in
14+ x86_64)
15+ HID_FLASH=${DIR} /linux/x86_64/hid-flash
16+ ;;
17+ aarch64|arm64)
18+ HID_FLASH=${DIR} /linux/aarch64/hid-flash
19+ ;;
20+ * )
21+ echo " Unsupported Linux architecture: ${UNAME_ARCH} ."
22+ exit 1
23+ ;;
24+ esac
25+ ;;
26+ Darwin* )
27+ HID_FLASH=${DIR} /macosx/hid-flash
28+ ;;
29+ Windows* )
30+ HID_FLASH=${DIR} /win/hid-flash.exe
31+ ;;
32+ * )
33+ echo " Unknown host OS: ${UNAME_OS} ."
34+ exit 1
35+ ;;
36+ esac
37+
38+ # Not found!
39+ if [ ! -x " ${HID_FLASH} " ]; then
40+ echo " $0 : error: cannot find ${HID_FLASH} " >&2
41+ exit 2
42+ fi
43+
44+ # Pass all parameters through
45+ " ${HID_FLASH} " " $@ "
You can’t perform that action at this time.
0 commit comments