Skip to content
This repository has been archived by the owner on Jul 24, 2019. It is now read-only.

Commit

Permalink
backport 2.1+ installer fixes back to phantomjs 1.9.8 installer
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Santos committed Mar 31, 2016
1 parent 0719f5d commit 017ec0c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
10 changes: 5 additions & 5 deletions README.md
@@ -1,4 +1,4 @@
phantomjs-prebuilt
phantomjs
==================

An NPM installer for [PhantomJS](http://phantomjs.org/), headless webkit with JS API.
Expand All @@ -9,7 +9,7 @@ Building and Installing
-----------------------

```shell
npm install phantomjs-prebuilt
npm install phantomjs
```

Or grab the source and
Expand Down Expand Up @@ -43,7 +43,7 @@ Below is an example of using this package via node.
```javascript
var path = require('path')
var childProcess = require('child_process')
var phantomjs = require('phantomjs-prebuilt')
var phantomjs = require('phantomjs')
var binPath = phantomjs.path

var childArgs = [
Expand All @@ -65,7 +65,7 @@ installed. The patch number is incremented when there is either an installer
update or a patch build of the phantom binary.

Pre-2.0, this package was published to NPM as [phantomjs](https://www.npmjs.com/package/phantomjs).
We changed the name to [phantomjs-prebuilt](https://www.npmjs.com/package/phantomjs-prebuilt) at
We changed the name to [phantomjs](https://www.npmjs.com/package/phantomjs) at
the request of PhantomJS team.

Deciding Where To Get PhantomJS
Expand All @@ -83,7 +83,7 @@ Alternatives include `https://bitbucket.org/ariya/phantomjs/downloads` (the offi
and `http://cnpmjs.org/downloads`.

```Shell
npm install phantomjs-prebuilt --phantomjs_cdnurl=https://bitbucket.org/ariya/phantomjs/downloads
npm install phantomjs --phantomjs_cdnurl=https://bitbucket.org/ariya/phantomjs/downloads
```

Or add property into your `.npmrc` file (https://www.npmjs.org/doc/files/npmrc.html)
Expand Down
12 changes: 6 additions & 6 deletions install.js
Expand Up @@ -20,7 +20,7 @@ var url = require('url')
var which = require('which')

var originalPath = process.env.PATH
var DEFAULT_CDN = 'https://github.com/Medium/phantomjs/releases/download/v2.1.1/'
var DEFAULT_CDN = 'https://github.com/Medium/phantomjs/releases/download/v1.9.19'

// If the process exits without going through exit(), then we did not complete.
var validExit = false
Expand Down Expand Up @@ -62,7 +62,7 @@ kew.resolve(true)
})
.then(function () {
var location = getTargetPlatform() === 'win32' ?
path.join(pkgPath, 'bin', 'phantomjs.exe') :
path.join(pkgPath, 'phantomjs.exe') :
path.join(pkgPath, 'bin' ,'phantomjs')

try {
Expand Down Expand Up @@ -437,16 +437,16 @@ function getDownloadSpec() {
var arch = getTargetArch()
if (platform === 'linux' && arch === 'x64') {
downloadUrl += 'linux-x86_64.tar.bz2'
checksum = '86dd9a4bf4aee45f1a84c9f61cf1947c1d6dce9b9e8d2a907105da7852460d2f'
checksum = 'a1d9628118e270f26c4ddd1d7f3502a93b48ede334b8585d11c1c3ae7bc7163a'
} else if (platform === 'linux' && arch == 'ia32') {
downloadUrl += 'linux-i686.tar.bz2'
checksum = '80e03cfeb22cc4dfe4e73b68ab81c9fdd7c78968cfd5358e6af33960464f15e3'
checksum = '4102450bb658157e9aef3e229828fade0aaa0de0663802b31a0edff4b5aedf85'
} else if (platform === 'darwin' || platform === 'openbsd' || platform === 'freebsd') {
downloadUrl += 'macosx.zip'
checksum = '538cf488219ab27e309eafc629e2bcee9976990fe90b1ec334f541779150f8c1'
checksum = '8f15043ae3031815dc5f884ea6ffa053d365491b1bc0dc3a0862d5ff1ac20a48'
} else if (platform === 'win32') {
downloadUrl += 'windows.zip'
checksum = 'd9fb05623d6b26d3654d008eab3adafd1f6350433dfd16138c46161f42c7dcc8'
checksum = 'da36853ece7d58b6f50813d3e598d8a16bb191b467ac32e1624a239a49de9104'
} else {
return null
}
Expand Down
2 changes: 1 addition & 1 deletion lib/phantomjs.js
Expand Up @@ -28,7 +28,7 @@ try {
* The version of phantomjs installed by this package.
* @type {number}
*/
exports.version = '2.1.1'
exports.version = '1.9.8'


/**
Expand Down
4 changes: 2 additions & 2 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "phantomjs-prebuilt",
"version": "2.1.7",
"name": "phantomjs",
"version": "1.9.20",
"keywords": [
"phantomjs",
"headless",
Expand Down

0 comments on commit 017ec0c

Please sign in to comment.