@@ -23,21 +23,22 @@ SDCCVERSION=$3
2323TOOLSVERSION=$4
2424PACKAGER=sduino
2525
26+ BASEURL=https://github.com/tenbaht/sduino/releases/download/v${COREVERSION}
2627
2728# ## helper functions #####################################################
2829
2930# format ID information for a file
3031print_filedata ()
3132{
32- URL=file://$( realpath $1 )
3333 FILENAME=$( basename " $1 " )
34+ URL=${BASEURL} /${FILENAME}
3435 SIZE=$( stat --printf=" %s" $1 )
3536 CHKSUM=$( shasum -a 256 $1 | cut " -d " -f1)
3637cat << EOF
37- "url": "$URL ",
38- "archiveFileName": "$FILENAME ",
39- "checksum": "SHA-256:$CHKSUM ",
40- "size": "$SIZE "
38+ "url": "$URL ",
39+ "archiveFileName": "$FILENAME ",
40+ "checksum": "SHA-256:$CHKSUM ",
41+ "size": "$SIZE "
4142EOF
4243}
4344
4647# list of supported boards in current boards.txt
4748list_boards ()
4849{
49- echo -n " \" boards\" : ["
50+ echo -n " \" boards\" : ["
5051 n=0
5152 sed -n " s/.*\.name=//p" ../sduino/hardware/sduino/stm8/boards.txt | \
5253 while read line; do
5354 if [ $n -ne 0 ]; then echo -n " ," ; fi
5455 echo
55- echo -n " {\" name\" : \" $line \" }"
56+ echo -n " {\" name\" : \" $line \" }"
5657 n=$(( n+ 1 ))
5758 done
5859 echo
59- echo " ],"
60+ echo " ],"
6061}
6162
6263
@@ -65,26 +66,25 @@ list_boards()
6566
6667cat << EOF
6768{
68- "name": "Sduino STM8 plain C core (non-C++)",
69- "architecture": "stm8",
70- "version": "$COREVERSION ",
71- "category": "Contributed",
69+ "name": "Sduino STM8 plain C core (non-C++)",
70+ "architecture": "stm8",
71+ "version": "$COREVERSION ",
72+ "category": "Contributed",
7273EOF
7374list_boards
7475cat << EOF
75- "toolsDependencies": [
76- {
77- "name": "STM8Tools",
78- "version": "$TOOLSVERSION ",
79- "packager": "$PACKAGER "
80- },
81- {
82- "name": "sdcc",
83- "version": "build.$SDCCVERSION ",
84- "packager": "$PACKAGER "
85- }
86- ],
76+ "toolsDependencies": [
77+ {
78+ "name": "STM8Tools",
79+ "version": "$TOOLSVERSION ",
80+ "packager": "$PACKAGER "
81+ },
82+ {
83+ "name": "sdcc",
84+ "version": "build.$SDCCVERSION ",
85+ "packager": "$PACKAGER "
86+ }
87+ ],
8788EOF
8889print_filedata " $COREFILE "
8990echo " },"
90-
0 commit comments