Skip to content
This repository has been archived by the owner on Jun 14, 2018. It is now read-only.

Commit

Permalink
Merge pull request #9 from trufflesuite/develop
Browse files Browse the repository at this point in the history
Merge develop -> master for Truffle 4 release
  • Loading branch information
gnidan authored Oct 31, 2017
2 parents 74551da + 3dfdc5e commit ceaa439
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
node_modules
package-lock.json
yarn.lock
13 changes: 6 additions & 7 deletions lib/utils/unbox.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var fs = require("fs-extra");
var path = require("path");
var ghdownload = require('github-download');
var https = require("https");
var request = require('request');
var vcsurl = require('vcsurl');
var parseURL = require('url').parse;
var tmp = require('tmp');
Expand Down Expand Up @@ -35,19 +35,18 @@ function verifyURL(url) {

var options = {
method: 'HEAD',
host: configURL.host,
path: configURL.path
uri: 'https://' + configURL.host + configURL.path
};
var req = https.request(options, function(r) {
if (r.statusCode == 404) {
request(options, function(error, r) {
if (error) {
return reject(new Error("Error making request. Please check the format of the requested resource: " + options.uri));
} else if (r.statusCode == 404) {
return reject(new Error("Truffle Box at URL " + url + " doesn't exist. If you believe this is an error, please contact Truffle support."));
} else if (r.statusCode != 200) {
return reject(new Error("Error connecting to github.com. Please check your internet connection and try again."));
}
accept();
});
req.end();

});
}

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "truffle-box",
"version": "1.0.2",
"version": "1.0.3",
"description": "Truffle project boilerplate utility",
"main": "box.js",
"scripts": {
Expand All @@ -23,6 +23,7 @@
"dependencies": {
"fs-extra": "^3.0.1",
"github-download": "^0.5.0",
"request": "^2.83.0",
"tmp": "^0.0.31",
"vcsurl": "^0.1.1"
}
Expand Down

0 comments on commit ceaa439

Please sign in to comment.