Skip to content

Commit

Permalink
Merge pull request #1 from seanbuscay/little-enhancements
Browse files Browse the repository at this point in the history
Add install cleanup scripts.  Add php error logging.  Return node integration.
  • Loading branch information
Sean Buscay authored Nov 15, 2016
2 parents a4a6924 + 17329c7 commit 03beeff
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 15 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ node_modules
web
bin
npm-debug.log
logs
.atom-build.yml
web_backup*
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,16 @@ Fix:

### Technical notes

#### Install locations
#### Install notes

- Drupal 8 installs
- within the `web` directory
- a sqlite db here: `web/sites/default/files/.ht.sqlite`
- the "JS symbol name collisions" fix to the "Classy" core theme
- PHP for OS X
- PHP
- installs within the `bin` directory
- uses a `php.ini` file here: `bin/php.ini`
- logs errors to `logs/electron-php-errors.log`
- Drush 8
- installs within the `bin` directory
- Drush uses a `drush.ini` file here: `bin/drush.ini`
Expand Down Expand Up @@ -140,7 +141,16 @@ Examples:

##### NPM Scripts

todo
Cleanup the previous install before running `npm install` again:

- `npm run wipe`
- will backup the current Drupal web directory
- will remove everything installed by `npm install`
- except any backups of the Drupal web directory

- `npm run wipe-all`
- will remove everything installed by `npm install`
- including any backups of the Drupal web directory

## Contributing to the Electron Drupal project

Expand Down
Binary file added app/images/app-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 6 additions & 4 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const app = electron.app
const BrowserWindow = electron.BrowserWindow

require('electron-debug')({showDevTools: false})

// php
var path = require('path')
var php = require('gulp-connect-php')
Expand Down Expand Up @@ -46,11 +47,12 @@ app.on('ready', function () {
mainWindow = new BrowserWindow({
width: 1024,
height: 768,
nodeIntegration: false,
nodeIntegration: true,
title: 'Electron Drupal',
webPreferences: {
webSecurity: false
}
icon: path.resolve(__dirname) + '/app/images/app-icon.png'
// webPreferences: {
// webSecurity: false
// }
})
// and load the app's front controller. Feel free to change with app_dev.php
mainWindow.loadURL('http://127.0.0.1:8088/index.php')
Expand Down
10 changes: 3 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,8 @@
"install-drush": "bash scripts/install-drush.sh",
"install-drupal": "bash scripts/install-drupal.sh",
"postinstall": "npm run install-php; npm run install-drush; npm run install-drupal",
"wipe-bin-install": "rm -R bin",
"wipe-npm-install": "rm -R node_modules",
"wipe-drupal-install": "sudo rm -R -f web",
"wipe": "npm run wipe-bin-install;npm run wipe-drupal-install; npm run wipe-npm-install",
"rebuild-versions": "electron-rebuild"
"wipe": "bash scripts/wipe.sh",
"wipe-all": "npm run wipe; sudo rm -R -f web_*"
},
"repository": {
"type": "git",
Expand All @@ -37,7 +34,6 @@
"electron-debug": "^1.1.0",
"devtron": "^1.4.0",
"debug-menu": "^0.4.0",
"electron-log": "^1.2.2",
"electron-rebuild": "^1.3.0"
"electron-log": "^1.2.2"
}
}
2 changes: 1 addition & 1 deletion php/default.php.ini
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ html_errors = On
; empty.
; http://php.net/error-log
; Example:
error_log = php_errors.log
error_log = "../logs/electron-php-errors.log"
; Log errors to syslog (Event Log on Windows).
;error_log = syslog

Expand Down
1 change: 1 addition & 0 deletions scripts/install-php.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/sh
echo 'Installing PHP'
mkdir bin
mkdir logs
cp php/osx/php bin/php
echo 'PHP install complete.'
echo 'Adding default .ini files'
Expand Down
20 changes: 20 additions & 0 deletions scripts/wipe.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/sh
echo 'Wiping install.'
rm -R bin || echo 'Did not remove the bin directory.'

rm -R logs || echo 'Did not remove the logs directory.'

rm npm-debug.log || echo 'Did not remove the npm-debug.log.'

rm -R node_modules || echo 'Did not remove node_modules directory.'

echo 'The script needs sudo permission to move the web directory.'
echo 'You may need to enter your password below.'

sudo mv web/ "web_backup_$(date +%Y_%m_%d_%H:%M:%S)/" || true

echo ''
echo 'Wipe complete.'
echo ''
echo 'If you receieved a message that a file or directory was not removed,'
echo 'it may have already been removed or you will need to delete it manually.'

0 comments on commit 03beeff

Please sign in to comment.