forked from arcbtc/bitcoinSwitch
-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathbuild-webinstaller.sh
More file actions
26 lines (22 loc) · 1.19 KB
/
build-webinstaller.sh
File metadata and controls
26 lines (22 loc) · 1.19 KB
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-$device.ino.bin
wget $RELEASE/$version/$PROJECT_NAME-$device.ino.partitions.bin
wget $RELEASE/$version/$PROJECT_NAME-$device.ino.bootloader.bin
mv $PROJECT_NAME-$device.ino.bin $INSTALLER_PATH/$device/$version/main.bin
mv $PROJECT_NAME-$device.ino.partitions.bin $INSTALLER_PATH/$device/$version/partitions.bin
mv $PROJECT_NAME-$device.ino.bootloader.bin $INSTALLER_PATH/$device/$version/bootloader.bin
done
done