mirror of
https://github.com/sstent/node.git
synced 2026-01-26 23:22:28 +00:00
first post
This commit is contained in:
26
Nodejs-Socketio-Mysql-Demo/node_modules/wd/lib/bin.js
generated
vendored
Normal file
26
Nodejs-Socketio-Mysql-Demo/node_modules/wd/lib/bin.js
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
var net = require('net')
|
||||
, repl = require('repl')
|
||||
, assert = require('assert')
|
||||
, wd = require('./main')
|
||||
;
|
||||
|
||||
var startRepl = function() {
|
||||
var r = repl.start('(wd): ');
|
||||
r.context.assert = assert;
|
||||
r.context.wd = wd;
|
||||
r.context.help = function() {
|
||||
console.log("WD - Shell.");
|
||||
console.log("Access the webdriver object via the object: 'wd'");
|
||||
};
|
||||
|
||||
net.createServer(function (socket) {
|
||||
connections += 1;
|
||||
repl.start("(wd): ", socket);
|
||||
}).listen("/tmp/node-repl-sock");
|
||||
};
|
||||
|
||||
if (process.argv[2] == "shell") {
|
||||
startRepl()
|
||||
}
|
||||
Reference in New Issue
Block a user