forked from arcbtc/bitcoinSwitch
-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathbuild-webinstaller.sh
26 lines (22 loc) · 1.1 KB
/
build-webinstaller.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
#!/bin/sh
PROJECT_NAME=bitcoinSwitch
RELEASE=https://github.com/lnbits/bitcoinSwitch/releases/download
INSTALLER_REPO=https://github.com/lnbits/hardware-installer
INSTALLER_PATH=./hardware-installer/public/firmware
git clone $INSTALLER_REPO
cp INSTALLER.md ./hardware-installer/public/INSTALLER.md
cp versions.json ./hardware-installer/src/versions.json
cp config.js ./hardware-installer/src/config.js
sed -i "s/%title%/$PROJECT_NAME/g" ./hardware-installer/index.html
mkdir -p $INSTALLER_PATH
for device in $(jq -r '.devices[]' ./hardware-installer/src/versions.json); do
for version in $(jq -r '.versions[]' ./hardware-installer/src/versions.json); do
mkdir -p $INSTALLER_PATH/$device/$version
wget $RELEASE/$version/$PROJECT_NAME.ino.bin
wget $RELEASE/$version/$PROJECT_NAME.ino.partitions.bin
wget $RELEASE/$version/$PROJECT_NAME.ino.bootloader.bin
mv $PROJECT_NAME.ino.bin $INSTALLER_PATH/$device/$version
mv $PROJECT_NAME.ino.partitions.bin $INSTALLER_PATH/$device/$version
mv $PROJECT_NAME.ino.bootloader.bin $INSTALLER_PATH/$device/$version
done
done