blob: e59a89a1aaad26613a779b1b07ada60cc398ea27 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
406,416c406
< if (!downloadSpec) {
< console.error(
< 'Unexpected platform or architecture: ' + getTargetPlatform() + '/' + getTargetArch() + '\n' +
< 'It seems there is no binary available for your platform/architecture\n' +
< 'Try to install PhantomJS globally')
< exit(1)
< }
<
< var downloadUrl = downloadSpec.url
< var downloadedFile
<
---
> var downloadedFile = "phantomjs.tar.bz2"
418,436c408
< // Can't use a global version so start a download.
< var tmpPath = findSuitableTempDirectory()
< var fileName = downloadUrl.split('/').pop()
< downloadedFile = path.join(tmpPath, fileName)
<
< if (fs.existsSync(downloadedFile)) {
< console.log('Download already available at', downloadedFile)
< return verifyChecksum(downloadedFile, downloadSpec.checksum)
< }
< return false
< }).then(function (verified) {
< if (verified) {
< return downloadedFile
< }
<
< // Start the install.
< console.log('Downloading', downloadUrl)
< console.log('Saving to', downloadedFile)
< return requestBinary(getRequestOptions(), downloadedFile)
---
> return downloadedFile
|