Files
xod/tools/spectron-repl
2017-10-21 10:00:44 +03:00

39 lines
910 B
JavaScript
Executable File

#!/usr/bin/env node
const repl = require('repl');
const Application = require('spectron').Application;
const app = new Application({
path: './node_modules/.bin/electron',
args: [
'./packages/xod-client-electron',
],
});
console.log('Starting XOD IDE...');
app.start()
.then(function() {
console.log('\nIDE started.\n');
console.log('Use `app` and `client` objects to control the application');
console.log('For reference see:');
console.log('- https://github.com/electron/spectron');
console.log('- http://webdriver.io/api.html');
console.log('');
})
.then(function() {
const r = repl.start('> ');
Object.defineProperty(r.context, 'app', {
configurable: false,
enumerable: true,
value: app,
});
Object.defineProperty(r.context, 'client', {
configurable: false,
enumerable: true,
value: app.client,
});
});