mirror of
https://github.com/actuallymentor/battery.git
synced 2026-02-03 14:03:24 +00:00
🐛 fix git check based on status message because xcode implements a freaking stub
This commit is contained in:
@@ -4,5 +4,5 @@ Development notes:
|
|||||||
- deploy new version:
|
- deploy new version:
|
||||||
- Update version in `package.json`
|
- Update version in `package.json`
|
||||||
- `npm run build`
|
- `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`
|
- Update [brew formula](https://github.com/Homebrew/homebrew-cask/blob/master/Casks/battery.rb) through`brew bump-cask-pr --version`
|
||||||
|
|||||||
@@ -1,9 +1,13 @@
|
|||||||
const { app } = require( 'electron' )
|
const { app } = require( 'electron' )
|
||||||
const { alert } = require( './modules/helpers' )
|
const { alert, log } = require( './modules/helpers' )
|
||||||
const { set_initial_interface } = require( './modules/interface' )
|
const { set_initial_interface } = require( './modules/interface' )
|
||||||
|
|
||||||
// Enable auto-updates
|
// Enable auto-updates
|
||||||
require( 'update-electron-app' )()
|
require( 'update-electron-app' )( {
|
||||||
|
logger: {
|
||||||
|
log: ( ...data ) => log( `[ update-electron-app ] `, ...data )
|
||||||
|
}
|
||||||
|
} )
|
||||||
|
|
||||||
/* ///////////////////////////////
|
/* ///////////////////////////////
|
||||||
// Event listeners
|
// Event listeners
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ const initialize_battery = async () => {
|
|||||||
log( `Internet online: ${ online }` )
|
log( `Internet online: ${ online }` )
|
||||||
|
|
||||||
// Check if xcode build tools are installed
|
// 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 ) {
|
if( !xcode_installed ) {
|
||||||
alert( `The Battery tool needs Xcode to be installed, please accept the terms and conditions for installation` )
|
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` )
|
await exec_async( `${ path_fix } xcode-select --install` )
|
||||||
|
|||||||
Reference in New Issue
Block a user