Skip to content

Commit

Permalink
version 0.8.3
Browse files Browse the repository at this point in the history
  • Loading branch information
ddmitov committed Jun 17, 2017
1 parent 47f2c98 commit 157e711
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ elephant-harness npm package test will fail if no ``php`` binary is available on

``php`` binary should be used in [Node.js](http://nodejs.org/) applications and test scripts.

``php-cgi`` binary should be used in all [Electron](http://electron.atom.io/) and [NW.js](http://nwjs.io/) applications.
``php-cgi`` binary should be used in [Electron](http://electron.atom.io/) and [NW.js](http://nwjs.io/) applications.

## API

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "elephant-harness",
"version": "0.8.2",
"version": "0.8.3",
"description": "Node.js - Electron - NW.js controller for PHP scripts",
"main": "src/elephant-harness.js",
"directories": {
Expand Down
1 change: 1 addition & 0 deletions src/elephant-harness-arguments.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
module.exports.setArguments = function(script) {
var interpreterArguments;

// Interpreter arguments, if any, go before the script full path:
if (script.interpreterSwitches !== undefined &&
Array.isArray(script.interpreterSwitches)) {
interpreterArguments = script.interpreterSwitches;
Expand Down
9 changes: 5 additions & 4 deletions src/elephant-harness-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ const filesystemObject = require('fs');
module.exports.checkSettings = function(script) {
var scriptSettingsOk = true;

// PHP interpreter, PHP script full path and
// name of the STDOUT handling function
// are mandatory function parameter object properties.
// Interpreter is mandatory script object property.
if (script.interpreter === undefined) {
console.log('elephant-harness: PHP interpreter is not supplied.');
scriptSettingsOk = false;
}

// Script full path is mandatory script object property.
if (script.scriptFullPath === undefined) {
console.log('elephant-harness: Script full path is not supplied.');
scriptSettingsOk = false;
}

// Script STDOUT handling function is mandatory script object property.
if (typeof script.stdoutFunction !== 'function') {
console.log('elephant-harness: STDOUT handling function is not defined.');
scriptSettingsOk = false;
Expand Down Expand Up @@ -67,12 +67,13 @@ module.exports.checkSettings = function(script) {
};

function checkScriptExistence(scriptFullPath) {
// This function returns only after file existence check is complete.
var scriptExists = true;

try {
filesystemObject.accessSync(scriptFullPath);
} catch (exception) {
console.log('elephant-harness: ' + scriptFullPath + ' not found.');
console.log('elephant-harness: ' + scriptFullPath + 'is not found.');
scriptExists = false;
}

Expand Down

0 comments on commit 157e711

Please sign in to comment.