Skip to content

Commit b7169b9

Browse files
committed
improve formatting of platform entry
1 parent 7186416 commit b7169b9

1 file changed

Lines changed: 25 additions & 25 deletions

File tree

board-manager/gen_platform_entry.sh

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,22 @@ SDCCVERSION=$3
2323
TOOLSVERSION=$4
2424
PACKAGER=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
3031
print_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)
3637
cat << 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"
4142
EOF
4243
}
4344

@@ -46,17 +47,17 @@ EOF
4647
# list of supported boards in current boards.txt
4748
list_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

6667
cat << 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",
7273
EOF
7374
list_boards
7475
cat << 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+
],
8788
EOF
8889
print_filedata "$COREFILE"
8990
echo "},"
90-

0 commit comments

Comments
 (0)