-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sh
27 lines (25 loc) · 848 Bytes
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
appname=$(ls *.bin | awk -F "." {'print $1'})
minGW32-make -j8
if [ $? -eq 0 ]; then
# success
filedate=$(date -r ${appname}.bin "+%Y%d%m %H:%M:%S")
filesize=$(du -h "${appname}.bin" | cut -f1)
githash=$(git rev-parse --short HEAD)
gitdirty=$(git diff --quiet || echo '+dirty')
if [ $? -ne 0 ]; then
printf "\n${appname}.bin ${filesize} ${filedate} (no git info available)}\n\n"
else
printf "\n${appname}.bin ${filesize} ${filedate} g${githash}${gitdirty}\n\n"
fi
if [ -d /d ]; then
printf "copying ${appname}.uf2 to Pico\n\n"
cp ${appname}.uf2 /d
else
printf "*****************************************************\n"
printf " Pico not in bootloader mode. Hold BOOT and restart.\n"
printf "*****************************************************\n"
fi
else
printf "build failed\n"
fi