Comparing version 2.0.1 to 2.0.2
@@ -141,5 +141,4 @@ var fs = require('fs'); | ||
var headerRequest = { uri: repoComponents+comp.files[filesDownloaded], rejectUnauthorized: false } | ||
var req = request(headerRequest) | ||
.pipe(fs.createWriteStream("."+folder+"/mobileui/"+comp.files[filesDownloaded])) | ||
.on('close', function (err) { | ||
request(headerRequest, function (err, response, body) { | ||
fs.writeFileSync("."+folder+"/mobileui/"+comp.files[filesDownloaded], response.data); | ||
filesDownloaded++; | ||
@@ -153,3 +152,15 @@ if(totalFiles === filesDownloaded) { | ||
}) | ||
// .pipe(fs.createWriteStream("."+folder+"/mobileui/"+comp.files[filesDownloaded])) | ||
// .on('close', function (err) { | ||
// filesDownloaded++; | ||
// if(totalFiles === filesDownloaded) { | ||
// console.log("> Files dependencies downloaded".grey) | ||
// callback(); | ||
// } else { | ||
// download(); | ||
// } | ||
// }) | ||
} | ||
download(); | ||
@@ -156,0 +167,0 @@ } else { |
const axios = require('axios'); | ||
module.exports = function (options, callback) { | ||
axios.get(options.uri) | ||
.then(function(response) { | ||
var axiosGet = axios.get(options.uri || options.url) | ||
// if(options.headers) { | ||
// var axiosGet = axios.get(options.uri, { | ||
// headers: options.headers | ||
// }) | ||
// } | ||
axiosGet.then(function(response) { | ||
response.statusCode = response.status | ||
@@ -7,0 +14,0 @@ callback(null, response, JSON.stringify(response.data)) |
{ | ||
"name": "mobileui", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "MobileUI is a simple and easy NPM package to install UI Components for web mobile apps using HTML, CSS and JavaScript.", | ||
@@ -5,0 +5,0 @@ "main": "./bin/mobileui", |
59147
856