From d3fba43a2e8fa8996c658987e3c16cffef519265 Mon Sep 17 00:00:00 2001 From: Mentor Date: Sun, 19 Feb 2023 11:31:31 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix=20git=20check=20based=20on?= =?UTF-8?q?=20status=20message=20because=20xcode=20implements=20a=20freaki?= =?UTF-8?q?ng=20stub?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/README.md | 2 +- app/main.js | 8 ++++++-- app/modules/battery.js | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/README.md b/app/README.md index 6f0c71d..945bcc8 100644 --- a/app/README.md +++ b/app/README.md @@ -4,5 +4,5 @@ Development notes: - deploy new version: - Update version in `package.json` - `npm run build` - - Create new [release](https://github.com/actuallymentor/battery/releases) + - Create new [release](https://github.com/actuallymentor/battery/releases) with both the `.dmg` and `.zip` (for `electron-updater`) - Update [brew formula](https://github.com/Homebrew/homebrew-cask/blob/master/Casks/battery.rb) through`brew bump-cask-pr --version` diff --git a/app/main.js b/app/main.js index f2b366d..a2b087d 100644 --- a/app/main.js +++ b/app/main.js @@ -1,9 +1,13 @@ const { app } = require( 'electron' ) -const { alert } = require( './modules/helpers' ) +const { alert, log } = require( './modules/helpers' ) const { set_initial_interface } = require( './modules/interface' ) // Enable auto-updates -require( 'update-electron-app' )() +require( 'update-electron-app' )( { + logger: { + log: ( ...data ) => log( `[ update-electron-app ] `, ...data ) + } +} ) /* /////////////////////////////// // Event listeners diff --git a/app/modules/battery.js b/app/modules/battery.js index a7baa95..2fd98bd 100644 --- a/app/modules/battery.js +++ b/app/modules/battery.js @@ -122,7 +122,7 @@ const initialize_battery = async () => { log( `Internet online: ${ online }` ) // Check if xcode build tools are installed - const xcode_installed = await exec_async( `${ path_fix } which git` ).catch( () => false ) + const xcode_installed = await exec_async( `${ path_fix } git | grep -q "usage: git"` ).catch( () => false ) if( !xcode_installed ) { alert( `The Battery tool needs Xcode to be installed, please accept the terms and conditions for installation` ) await exec_async( `${ path_fix } xcode-select --install` )