🐛 fix git check based on status message because xcode implements a freaking stub

This commit is contained in:
Mentor
2023-02-19 11:31:31 +01:00
parent 62768e2267
commit d3fba43a2e
3 changed files with 8 additions and 4 deletions

View File

@@ -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`

View File

@@ -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

View File

@@ -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` )