mirror of
https://github.com/mmvanheusden/SteamDepotDownloaderGUI.git
synced 2026-02-04 05:31:19 +01:00
fix: prevent devtools from automatically opening on non-dev environments
This commit is contained in:
10
main.js
10
main.js
@@ -19,10 +19,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
2
package-lock.json
generated
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "steamdepotdownloadergui",
|
||||
"version": "2.3.0",
|
||||
"version": "2.3.1",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "steamdepotdownloadergui",
|
||||
"version": "2.3.0",
|
||||
"version": "2.3.1",
|
||||
"description": "DepotDownloader Electron frontend",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
|
||||
18
package.sh
18
package.sh
@@ -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
|
||||
Reference in New Issue
Block a user