Testing postinst/prerm scripts with the UI .deb (#11258)

This commit is contained in:
Chris Marslender 2022-04-21 18:59:27 -05:00 committed by GitHub
parent cb98258a8e
commit 077c8db1ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 27 additions and 2 deletions

View File

@ -0,0 +1,7 @@
#!/usr/bin/env bash
# Post install script for the UI .deb to place symlinks in places to allow the CLI to work similarly in both versions
set -e
ln -s /usr/lib/chia-blockchain/resources/app.asar.unpacked/daemon/chia /usr/bin/chia || true
ln -s /usr/lib/chia-blockchain/resources/app.asar.unpacked/daemon /opt/chia || true

View File

@ -0,0 +1,7 @@
#!/usr/bin/env bash
# Pre remove script for the UI .deb to clean up the symlinks from the installer
set -e
unlink /usr/bin/chia || true
unlink /opt/chia || true

View File

@ -98,8 +98,10 @@ cd ../../../build_scripts || exit
echo "Create chia-$CHIA_INSTALLER_VERSION.deb"
rm -rf final_installer
mkdir final_installer
electron-installer-debian --src dist/$DIR_NAME/ --dest final_installer/ \
--arch "$PLATFORM" --options.version $CHIA_INSTALLER_VERSION --options.bin chia-blockchain --options.name chia-blockchain
electron-installer-debian --src "dist/$DIR_NAME/" \
--arch "$PLATFORM" \
--options.version "$CHIA_INSTALLER_VERSION" \
--config deb-options.json
LAST_EXIT_CODE=$?
if [ "$LAST_EXIT_CODE" -ne 0 ]; then
echo >&2 "electron-installer-debian failed!"

View File

@ -0,0 +1,9 @@
{
"dest": "final_installer/",
"bin": "chia-blockchain",
"name": "chia-blockchain",
"scripts": {
"postinst": "assets/deb/postinst.sh",
"prerm": "assets/deb/prerm.sh"
}
}