From 601e69604f92f43d8cb38ad1b6dc13133133c5e6 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 12 Jun 2012 14:18:27 +0000 Subject: [PATCH] test.js ls --- test/test.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/test/test.js b/test/test.js index 14150186..c3d9a2ba 100644 --- a/test/test.js +++ b/test/test.js @@ -2,15 +2,17 @@ var util = require('util'), exec = require('child_process').exec, child; -var lScript='curl http://phantomjs.googlecode.com/files/phantomjs-1.5.0-linux-x86-dynamic.tar.gz &&' + - 'tar -zxf phantomjs-1.5.0-linux-x86-dynamic.tar.gz'+ - './phantomjs/bin/phantomjs && ls'; + -child = exec(lScript, - function (error, stdout, stderr) { +exec('curl http://phantomjs.googlecode.com/files/phantomjs-1.5.0-linux-x86-dynamic.tar.gz',execFunctoin); +exec('tar -zxf phantomjs-1.5.0-linux-x86-dynamic.tar.gz',execFunctoin); +exec('./phantomjs/bin/phantomjs',execFunctoin); + +function execFunctoin(error, stdout, stderr) { console.log('stdout: ' + stdout); console.log('stderr: ' + stderr); + if (error !== null) { - console.log('exec error: ' + error); + console.log('exec error: ' + error); } -}); \ No newline at end of file +} \ No newline at end of file