Merge branch 'hotfix-devtools'

This commit is contained in:
Maarten
2023-12-08 17:29:59 +01:00
4 changed files with 24 additions and 8 deletions

10
main.js
View File

@@ -20,10 +20,12 @@ const createWindow = () => {
// and load the index.html of the app.
mainWindow.loadFile("index.html")
// Open the DevTools for debugging, only if not in production.
if (!app.isPackaged) {
mainWindow.webContents.openDevTools({mode: "detach"})
}
// @formatter:off
// Open the DevTools for debugging, only if not in production. This is removed for release by the build script (package.sh) because it's unreliable.
// disable formatting so the line always stays the same so sed can find it
// eslint-disable-next-line no-undef
if (!app.isPackaged) mainWindow.webContents.openDevTools({mode: "detach"})
// @formatter:on
}
// This method will be called when Electron has finished

2
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "steamdepotdownloadergui",
"version": "2.3.0",
"version": "2.3.1",
"lockfileVersion": 3,
"requires": true,
"packages": {

View File

@@ -1,6 +1,6 @@
{
"name": "steamdepotdownloadergui",
"version": "2.3.0",
"version": "2.3.1",
"description": "DepotDownloader Electron frontend",
"main": "main.js",
"scripts": {

View File

@@ -1,11 +1,25 @@
#!/usr/bin/env bash
set -e
version=`jq '.version' package.json`
version="${version//\"}"
echo "version = ${version}"
echo "version that will be build is ${version}"
rm -rf ./dist/
# Disable DevTools for release, because it's unreliable
original_line=$(sed -n '/if (!app.isPackaged) mainWindow.webContents.openDevTools({mode: "detach"})/p' main.js)
# original_line has 1 tab too much, so we remove it
original_line="${original_line// /}"
sed -i 's/if (!app.isPackaged) mainWindow.webContents.openDevTools({mode: "detach"})/\/\/REMOVED FOR RELEASE./g' main.js
npm run build
mkdir -p ./dist/release-ready
cp ./dist/SteamDepotDownloaderGUI*.exe ./dist/release-ready/SteamDepotDownloaderGUI-windows-"${version}".exe
cp `ls -d1 dist/* | grep -E "SteamDepotDownloaderGUI-[0-9]+\.[0-9]+\.[0-9]+\.AppImage"` ./dist/release-ready/SteamDepotDownloaderGUI-linux-"${version}"-x64.AppImage
cp `ls -d1 dist/* | grep -E "steamdepotdownloadergui-[0-9]+\.[0-9]+\.[0-9]+\.zip"` ./dist/release-ready/SteamDepotDownloaderGUI-linux-"${version}"-x64.zip
cp `ls -d1 dist/* | grep -E "SteamDepotDownloaderGUI-[0-9]+\.[0-9]+\.[0-9]+\-arm64.AppImage"` ./dist/release-ready/SteamDepotDownloaderGUI-linux-"${version}"-arm64.AppImage
cp `ls -d1 dist/* | grep -E "steamdepotdownloadergui-[0-9]+\.[0-9]+\.[0-9]+\-arm64.zip"` ./dist/release-ready/SteamDepotDownloaderGUI-linux-"${version}"-arm64.zip
echo "done!"
echo "done building!"
echo "reverting changes to main.js"
sed -i "s|\/\/REMOVED FOR RELEASE.|$original_line|g" main.js