Skip to content

Commit

Permalink
Replaced all this with _this, just for readbility, not functionality)
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick committed Jun 5, 2015
1 parent fab4c24 commit fcd09c4
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ function CertDownloader(options) {
* the location of the certificate.
*/
CertDownloader.prototype.cert = function (callback) {
var certPath = require('path').join(this.cachePath, this.certName);
var _this = this;
if (this.fs.exists(certPath)) {
var certPath = require('path').join(_this.cachePath, _this.certName);
if (_this.fs.exists(certPath)) {
callback(null, certPath);
} else {
require('http').get(this.rootUrl, function (res) {
require('http').get(_this.rootUrl, function (res) {
var downloadStream = _this.fs.createWriteStream(certPath);
res.pipe(downloadStream);
return downloadStream.on('finish', function () {
Expand All @@ -91,12 +91,12 @@ CertDownloader.prototype.cert = function (callback) {
* to the location of the certificate.
*/
CertDownloader.prototype.pem = function (callback) {
var pemPath = require('path').join(this.cachePath, this.util.format('%s.pem', this.certName.split('.')[0]));
var _this = this;
if (this.fs.exists(pemPath)) {
var pemPath = require('path').join(_this.cachePath, _this.util.format('%s.pem', _this.certName.split('.')[0]));
if (_this.fs.exists(pemPath)) {
callback(null, pemPath);
} else {
this.cert(function (error, certPath) {
_this.cert(function (error, certPath) {
if (error) {
callback(error);
} else {
Expand Down Expand Up @@ -128,7 +128,7 @@ CertDownloader.prototype.pem = function (callback) {
*/
CertDownloader.prototype.verify = function (file, callback) {
var _this = this;
this.pem(function (error, pemPath) {
_this.pem(function (error, pemPath) {
if (error) {
return callback(error);
}
Expand Down

0 comments on commit fcd09c4

Please sign in to comment.