Skip to content

Instantly share code, notes, and snippets.

@broqdev
Created January 25, 2013 08:05
Show Gist options
  • Save broqdev/4632657 to your computer and use it in GitHub Desktop.
Save broqdev/4632657 to your computer and use it in GitHub Desktop.

Revisions

  1. broqdev created this gist Jan 25, 2013.
    30 changes: 30 additions & 0 deletions phantomjs_instal_js.patch
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,30 @@
    --- install2.js 2013-01-25 15:32:38.358227000 +0800
    +++ install.js 2013-01-25 14:29:55.639011700 +0800
    @@ -108,7 +108,9 @@
    unzipStream.on('error', finishIt)
    unzipStream.on('close', finishIt)

    - var readStream = fs.createReadStream(downloadedFile)
    + var zipPath = path.normalize('d:/node/phantomjs-1.8.0-windows.zip')
    + var readStream = fs.createReadStream(zipPath)
    + //var readStream = fs.createReadStream(downloadedFile)
    readStream.pipe(unzipStream)
    readStream.on('error', finishIt)
    readStream.on('close', function () { console.log('Read stream closed')})
    @@ -127,6 +129,8 @@
    rimraf(libPath)

    mkdir(downloadedFile)
    + extractIt()
    +/*
    var outFile = fs.openSync(downloadedFile, 'w')

    function onData(data) {
    @@ -161,6 +165,7 @@
    var client = http.get(getOptions(), onResponse)

    console.log('Requesting ' + downloadedFile)
    +*/
    }

    fetchIt()